Skip to content
ghostui

Preview

Design guidance

Use Checkbox for an independent boolean. Use RadioGroup for one choice from a set and Switch for an immediate setting.

Installation

Install the local ghost-kit source bundle while the registry runs at localhost:3110. It contains this component and its source dependencies. Prepare the local registry first so token dependencies also resolve locally.

Install

Basic usage

Structures

Examples

Interactive style

Use variant="interactive" to add row hover feedback and an inner control fill. Both styles fill the core control on hover. The default keeps the row and text unchanged. Set the variant on Checkbox.Row to style the control and its companion text. Checkbox.Root can override the control style. Keyboard focus remains visible in both styles.

Basic checkbox

Use a checkbox for one independent choice. Click its label to toggle the value.

With a field label

Field connects the label and description to the checkbox. The control stays beside the label, and the whole row remains clickable.

Native button

Render the checkbox as a native button with nativeButton and render. The button still behaves as a checkbox.

Control states

Checked, mixed, and disabled states preserve the same control geometry. A mixed state is useful for a parent that represents partially selected descendants.

checkbox-states.tsx

API reference

variant accepts "default" | "interactive" and defaults to "default". Checkbox.Row sets the row and control style; Checkbox.Root can override the control. Both inherit a containing CheckboxGroup style when unset.

For inherited behavior and additional part properties, see the Base UI Checkbox API.