Skip to content
Nana UI

Checkbox

View .md Download

A form-associated checkbox. Works inside a native <form>, supports the indeterminate state, and offers card / toggle tile variants for selection UIs.

Accept terms and conditions
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/checkbox";
<nana-checkbox>Accept terms and conditions</nana-checkbox>
Small Medium Large
Checked Indeterminate Disabled Checked & disabled

Properties

PropertyAttributeTypeDefaultDescription
checkedbooleanfalseChecked state
descriptionstring | undefinedSecondary descriptive text
disabledbooleanfalseDisable the control
indeterminatebooleanfalseIndeterminate (mixed) state — for "some children selected"
invalidbooleanfalseInvalid styling + state
labelstring | undefinedConvenience label text (slot wins if both are present)
loadingbooleanfalseReplace the box with a spinner
namestring''Form field name
requiredbooleanfalseMark as required for form validation
sizeCheckboxSize'md'Control size
valuestring'on'Submitted value when checked (default "on")
variantCheckboxVariant'default'Visual style

Events

EventDescription
nana-changeFired on toggle (`detail.checked`, `detail.indeterminate`)

Slots

SlotDescription
(default)The label (overrides the `label` attribute)
descriptionSecondary descriptive text

CSS parts

PartDescription
::part(control)The clickable row
::part(box)The check box
::part(label)The label text

CSS custom properties

PropertyDescription
--nana-checkbox-accentChecked background / border colour
--nana-checkbox-radiusBox corner radius
EventTypeDescription
nana-changeCustomEventFired on toggle (detail.checked, detail.indeterminate)
SlotDescription
(default)The label (overrides the label attribute)
descriptionSecondary descriptive text
VariableDefaultDescription
--nana-checkbox-accentChecked background / border colour
--nana-checkbox-radiusBox corner radius
PartDescription
controlThe clickable row
boxThe check box
labelThe label text
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Checkbox interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook