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";

Examples

Overview

variant

With Radio Group

direction
description
Choose how you'd like to be notified.
Select the topics you want to follow.

Descriptions

Configure which emails you receive.

Variants

solid
solid pill
ghost

Pill

Ghost

With description

By checking this box, you agree to our Terms of Service and Privacy Policy.
You can enable or disable notifications at any time from settings.

Indeterminate

Disabled

solid
solid pill
ghost

Label orientation

orientation

Without label

Group with select all

Group with description

Select the items you want to display on the desktop.

With Field

Please review and accept the terms before continuing.

Grouped sections

Configure which emails you receive.
Configure which push notifications you receive.

API

PropTypeDefaultDescription
variant"solid" | "ghost""solid"Visual style: solid (filled background) or ghost (checkmark only)
pillbooleanfalseFully rounded indicator corners
checkedboolean | "indeterminate"—Controlled state
defaultCheckedboolean | "indeterminate"—Initial state (uncontrolled)
onCheckedChange(next: boolean) => void—Called with the next state when it changes
labelReactNode—Accessible label. Accepts ReactNode for rich content
descriptionReactNode—Second line below the label, linked via aria-describedby. Renders only with a label
disabledbooleanfalsePrevent interaction
requiredboolean—Required for form submission
namestring—Form field name
valuestring"on"Value when submitted
orientation"left" | "right""left"Checkbox position relative to the label
classNamestring—CSS classes applied to the wrapper node
idstring—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 (default var(--radio-group-indicator-size))
  • --checkbox-label-gap: label gap (default var(--radio-group-item-gap))
  • --checkbox-label-line-height: label line height (default var(--radio-group-item-line-height))
  • --input-border-color-invalid: border color invalid (default var(--color-border-danger-outline))