Checkbox
A control that allows the user to toggle between checked and not checked.
By clicking this checkbox, you agree to the terms and conditions.
Installation
pnpm add @heyramzi/ui bits-uiUsage
import { Checkbox } from "@heyramzi/ui/shadcn/checkbox";Keyboard and accessibility
| Key | Does |
|---|---|
| Space | Checks or unchecks the box. |
- Enter does nothing, so it can't submit the form by accident.
- An indeterminate box reports mixed. Space from there checks it.
API reference
refbindableHTMLElement | null- Default
null checkedbindableboolean- Default
false indeterminatebindableboolean- Default
false classstring...rest- Every prop of
Checkbox.Rootfrombits-uiexceptchild, children
| Prop | Type | Default |
|---|---|---|
ref bindable | HTMLElement | null | null |
checked bindable | boolean | false |
indeterminate bindable | boolean | false |
class | string | |
...rest | Every prop of Checkbox.Root from bits-ui except child, children | |