Reactolith UI Getting Started Introduction Installation Usage Layout Aspect Ratio Card Resizable Scroll Area Separator Direction Provider Forms Button Button Group Calendar Checkbox Combobox Field Input Input Group Input OTP Label Native Select Radio Group Select Slider Switch Textarea Toggle Toggle Group Data Display Accordion Avatar Badge Carousel Chart Collapsible Item Kbd Table Feedback Alert Empty Progress Skeleton Sonner Spinner Overlay Alert Dialog Context Menu Dialog Dropdown Menu Hover Card Popover Sheet Tooltip Navigation Breadcrumb Command Menubar Navigation Menu Pagination Sidebar Tabs

Checkbox

A control that allows the user to toggle between checked and not checked.

Preview

Accept terms and conditions
Subscribe to newsletter
Disabled checkbox

Usage

<div class="space-y-4">
  <div class="flex items-center gap-3">
    <ui-checkbox id="terms"></ui-checkbox>
    <ui-label for="terms">Accept terms and conditions</ui-label>
  </div>
  <div class="flex items-center gap-3">
    <ui-checkbox id="newsletter" defaultChecked></ui-checkbox>
    <ui-label for="newsletter">Subscribe to newsletter</ui-label>
  </div>
  <div class="flex items-center gap-3">
    <ui-checkbox id="disabled-cb" disabled></ui-checkbox>
    <ui-label for="disabled-cb">Disabled checkbox</ui-label>
  </div>
</div>

Sub-components

<ui-checkbox>

Props

<ui-checkbox>

PropTypeDefaultDescription
checkedbooleanfalseControlled checked state.
defaultCheckedbooleanfalseDefault checked state.
disabledbooleanfalseWhether the checkbox is disabled.
namestringThe name for form submission.

All components also accept standard HTML attributes (class, id, style, data-*, aria-*, etc.) which are passed through to the underlying element.