1.1.1 • Published 5 years ago
use-checkbox v1.1.1
Hooks for checkbox
How use?
The checkboxes options is based in an array of objects, and at each object the key and checked propriety is required.
See the example.
const options = [
{
key: 'bacon',
label: 'Bacon',
checked: true
},
{
key: 'apple',
label: 'Apple',
checked: false
}
]
const {checkboxes, setChecked} = useCheckbox(options)