MCPcopy Create free account
hub / github.com/reactstrap/reactstrap / Example

Function Example

stories/examples/Form/SwitchesExample.js:4–33  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

2import { Form, FormGroup, Label, Input } from 'reactstrap';
3
4function Example(props) {
5 const [state, setState] = useState(true);
6
7 return (
8 <Form>
9 <FormGroup switch>
10 <Input type="switch" role="switch" />
11 <Label check>Default switch checkbox input</Label>
12 </FormGroup>
13 <FormGroup switch>
14 <Input
15 type="switch"
16 checked={state}
17 onChange={() => {
18 setState(!state);
19 }}
20 />
21 <Label check>Checked switch checkbox input</Label>
22 </FormGroup>
23 <FormGroup switch disabled>
24 <Input type="switch" disabled />
25 <Label check>Disabled switch checkbox input</Label>
26 </FormGroup>
27 <FormGroup switch disabled>
28 <Input type="switch" checked disabled />
29 <Label check>Default switch checkbox input</Label>
30 </FormGroup>
31 </Form>
32 );
33}
34
35export default Example;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…