Skip to content

iamgbayer/use-checkbox

Repository files navigation

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)

Demo

Edit Checkbox

License

MIT © Guilherme Bayer

Releases

No releases published

Packages

No packages published