Using the useCheckboxState hook to control the state of the Checkbox component.
1
2
3
4
5
6
7
8
9
10
11
12
13
import{ Checkbox, useCheckboxState }from"ariakit/checkbox";import"./style.css";exportdefaultfunctionExample(){const checked =useCheckboxState({ defaultValue:true});return(<labelclassName="label"><CheckboxclassName="checkbox"state={checked}/> I have read and agree to
the terms and conditions
</label>);}