Checkbox
Checkbox for binary on/off selection with solid, pill, and ghost variants, an indeterminate state, and rich labels with inline descriptions.
import { Checkbox } from "@plexui/ui/components/Checkbox";On Phone, a single checkbox stays next to its label, while a list of options goes in the rows of a FieldGroup: each Field row names an option and ends with the checkbox, as in an iOS settings list.
Examples
Overview
variant
With Radio Group
direction
description
Choose how you'd like to be notified.
Select the topics you want to follow.
Descriptions
Choose what the archive includes.
Variants
solid
ghost
Pill
Ghost
With description
Help improve the product with anonymous usage reports.
You can enable or disable notifications at any time from settings.
Indeterminate
Label orientation
orientation
Without label
Group with select all
Group with description
Download over cellular
Choose what can use mobile data.
With Field
Terms
Please review and accept the terms before continuing.
Grouped sections
API
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "solid" | "ghost" | "solid" | Visual style: solid (filled background) or ghost (checkmark only) |
pill | boolean | false | Fully rounded indicator corners |
checked | boolean | "indeterminate" | — | Controlled state |
defaultChecked | boolean | "indeterminate" | — | Initial state (uncontrolled) |
onCheckedChange | (next: boolean) => void | — | Called with the next state when it changes |
label | ReactNode | — | Accessible label. Accepts ReactNode for rich content |
description | ReactNode | — | Second line below the label, linked via aria-describedby. Renders only with a label |
disabled | boolean | false | Prevent interaction |
required | boolean | — | Required for form submission |
name | string | — | Form field name |
value | string | "on" | Value when submitted |
orientation | "left" | "right" | "left" | Checkbox position relative to the label |
className | string | — | CSS classes applied to the wrapper node |
id | string | — | The id of the checkbox element (generated when omitted) |
onFocus | (event: FocusEvent) => void | — | Called when the checkbox gains focus |
onBlur | (event: FocusEvent) => void | — | Called when the checkbox loses focus |
Styling
Checkbox reads these component tokens. Override them at any scope to restyle it:
--checkbox-indicator-size: indicator size (defaultvar(--radio-group-indicator-size))--checkbox-ghost-check-color: checkmark color for the ghost variant (defaultvar(--gray-900))--checkbox-checkmark-color: checkmark color on a solid box (defaultvar(--gray-0))--checkbox-check-icon-size: size of the Check and Minus icons on a solid box (default the indicator size)--checkbox-ghost-icon-size: size of the Check and Minus icons for the ghost variant (default the indicator size; 26px in the touch stylesheet)--checkbox-label-gap: label gap (defaultvar(--radio-group-item-gap))--checkbox-label-line-height: label line height (defaultvar(--radio-group-item-line-height))--input-border-color-invalid: border color invalid (defaultvar(--color-border-danger-outline))