UNPKG

materialuiupgraded

Version:

Material-UI's workspace package

63 lines (58 loc) 1.77 kB
import React from 'react'; import FormLabel from '@material-ui/core/FormLabel'; import FormControl from '@material-ui/core/FormControl'; import FormGroup from '@material-ui/core/FormGroup'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import FormHelperText from '@material-ui/core/FormHelperText'; import Switch from '@material-ui/core/Switch'; class SwitchesGroup extends React.Component { state = { gilad: true, jason: false, antoine: true, }; handleChange = name => event => { this.setState({ [name]: event.target.checked }); }; render() { return ( <FormControl component="fieldset"> <FormLabel component="legend">Assign responsibility</FormLabel> <FormGroup> <FormControlLabel control={ <Switch checked={this.state.gilad} onChange={this.handleChange('gilad')} value="gilad" /> } label="Gilad Gray" /> <FormControlLabel control={ <Switch checked={this.state.jason} onChange={this.handleChange('jason')} value="jason" /> } label="Jason Killian" /> <FormControlLabel control={ <Switch checked={this.state.antoine} onChange={this.handleChange('antoine')} value="antoine" /> } label="Antoine Llorca" /> </FormGroup> <FormHelperText>Be careful</FormHelperText> </FormControl> ); } } export default SwitchesGroup;