Checkbox

Accessible checkbox with checked, unchecked, and indeterminate states.

Live Demo

You can change this in your account settings.

Props

PropTypeDefaultDescription
labelstringcomponentPages.checkbox_prop_label
descriptionstringcomponentPages.checkbox_prop_description
checkedboolean | 'indeterminate'componentPages.checkbox_prop_checked
onCheckedChange(checked: boolean | 'indeterminate') => voidcomponentPages.checkbox_prop_onCheckedChange
disabledbooleanfalsecomponentPages.checkbox_prop_disabled
idstringcomponentPages.checkbox_prop_id

Usage

import { Checkbox } from '@ghiberti85/ui'

// Basic
<Checkbox id="terms" label="Accept terms and conditions" />

// With description
<Checkbox
  id="marketing"
  label="Marketing emails"
  description="Receive updates about new features."
/>

// Indeterminate
<Checkbox id="all" label="Select all" checked="indeterminate" />

// Controlled
<Checkbox
  id="notif"
  label="Enable notifications"
  checked={checked}
  onCheckedChange={setChecked}
/>

// Disabled
<Checkbox id="opt" label="Unavailable option" disabled />

View in Storybook

Open in Storybook
Ghiberti UI — Design System