Checkbox
Loading example…
Checkbox is part of the Atoms set, imported from @jcsoftdev/ui/atoms.
Import
Section titled “Import”import { Checkbox } from "@jcsoftdev/ui/atoms";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/atoms/checkbox.
<Checkbox aria-label="Cita completada" />| Prop | Type | Default | Description |
|---|---|---|---|
classNames |
Partial<Record<CheckboxPart, string>> |
Per-part classes merged with cn; consumer classes win. className still targets the root and is merged last. |
|
checked |
boolean | "indeterminate" |
||
defaultChecked |
boolean | "indeterminate" |
||
onCheckedChange |
((checked: CheckedState) => void) |
||
required |
boolean |
||
name |
string |
||
value |
string |
"on" |
|
form |
string |
Id of the <form> the checkbox belongs to when it is rendered outside it. |
|
label |
ReactNode |
Text shown next to the box. It renders a <label> tied to the checkbox, so it names it for assistive tech and a click on it toggles. Without it the checkbox is bare and needs aria-label. |
|
description |
ReactNode |
||
intent |
string |
||
intentKey |
string |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”- Default
- Checked
- Disabled
- Disabled Checked
- Controlled Checklist
- Indeterminate
- Enter Does Not Toggle
- Form Submit And Reset
- With Label
- Touch Hit Area
- With Label And Description
Source
Section titled “Source”packages/ui/src/atoms/checkbox/checkbox.tsx