The Toggle component is used to toggle a boolean. True/false.
import { Toggle } from 'react-powerplug'
<Toggle initial={false}>
{({ on, toggle }) => <Checkbox onClick={toggle} checked={on} />}
</Toggle>
initial = false (optional)
Specifies the initial on state, must be an boolean.
By default, the initial on state is false.
onChange (optional)
The onChange event of the Toggle is called whenever the on state changes.
TL;DR: { on, toggle, set }
on
boolean
Your on
state value
toggle
() => void
Toggle your on
state value
set
(value: boolean) => void
Arbitrary set a value to on
state