react-toolbox/docs/app/components/layout/main/modules/examples/list_example_1.txt

49 lines
1.3 KiB
Plaintext

class ListTest extends React.Component {
state = {
checkbox: false
};
handleCheckboxChange = () => {
this.setState({checkbox: !this.state.checkbox});
};
render () {
return (
<List selectable ripple>
<ListSubHeader caption='Explore characters' />
<ListItem
avatar='https://placeimg.com/80/80/animals'
caption='Dr. Manhattan'
legend="Jonathan 'Jon' Osterman"
rightIcon='star'
/>
<ListItem
avatar='https://placeimg.com/80/80/animals'
caption='Ozymandias'
legend='Adrian Veidt'
rightIcon='star'
/>
<ListItem
avatar='https://placeimg.com/80/80/animals'
caption='Rorschach'
legend='Walter Joseph Kovacs'
rightIcon='star'
/>
<ListSubHeader caption='Configuration' />
<ListCheckbox
caption='Notify new comics'
checked={this.state.checkbox}
legend='You will receive a notification when a new one is published'
onChange={this.handleCheckboxChange}
/>
<ListDivider />
<ListItem caption='Contact the publisher' leftIcon='send' />
<ListItem caption='Remove this publication' leftIcon='delete' />
</List>
);
}
}
return <ListTest />;