byronwade/ui
Application UI

Forms · Application UI

Checkbox

A styled checkbox input built on Base UI's headless Checkbox primitive, rendering a checkmark indicator with focus, disabled, and validation states.

Feature showcase

Installation

Features

  • 1 example

    Default.

API

Props

PropTypeDefaultDescription
checkedboolean-Controlled checked state of the checkbox.
defaultCheckedbooleanfalseInitial checked state for uncontrolled usage.
onCheckedChange(checked: boolean, eventDetails: CheckboxRootChangeEventDetails) => void-Callback fired when the checkbox is ticked or unticked.
disabledbooleanfalsePrevents user interaction and applies disabled styling.
readOnlybooleanfalsePrevents the user from ticking or unticking the checkbox.
requiredbooleanfalseMarks the checkbox as required for form submission.
indeterminatebooleanfalsePuts the checkbox in a mixed state, neither checked nor unchecked.
namestring-Field name submitted with the form.
valuestring-Value submitted with the form when the checkbox is checked.
classNamestring-Additional CSS classes merged onto the root element.

Source and related

FilePath
Componentregistry/ui/checkbox.tsx
Default examplecontent/examples/checkbox/default.tsx