React-sim
GitHub

Toggle

A Toggle is functionally equivalent to a checkbox, but looks differently. Like the checkbox, it doesn't need anything else besides the common props.

<Model
showTimer={false}
initialParams={{ checked: false }}
controls={{
type: 'toggle',
label: 'Check me',
param: 'checked',
}}
/>

Two controls can act on the same param:

<Model
showTimer={false}
initialParams={{ checked: false }}
controls={[
{
type: 'checkbox',
label: 'Check me',
param: 'checked',
},
{
type: 'toggle',
label: 'Toggle me',
param: 'checked',
},
]}
/>
Edit this page on GitHub
Previous:
Checkbox
Next:
Radio
React-SimGitHub