Components/Misc/Checkbox

Checkbox

Misc

Accessible checkbox with label and indeterminate state.

Hard-edge checkbox with optional label and description below. Supports indeterminate state for parent-of-children selection patterns. Use CheckboxGroup when managing multiple related checkboxes.

Usage

import { Checkbox } from "nosible-ux"

export default function Example() {
  return <Checkbox label="Include pre-market signals" />
}

Examples

With label and description

Notify when earnings reports are published

Notify on forward guidance revisions

Indeterminate state

Some regions are selected

Error state

You must accept the terms to continue.

Accessibility

Renders a button element with role="checkbox" via Radix. Label is linked with htmlFor. Indeterminate state sets aria-checked="mixed". Error text is linked via aria-describedby.

Props

Name TypeDefaultDescription
aria-describedby
string | undefinedIDs of external elements that describe this control.
aria-label
string | undefinedaria-label for the control when no visible label is provided.
checked
boolean | "indeterminate" | undefinedundefinedControlled checked state. Supports true, false, or "indeterminate".
defaultChecked
boolean | "indeterminate" | undefinedfalseUncontrolled initial state.
description
ReactNodeSupporting text rendered below the label in text-text-muted.
error
ReactNodeError message shown below description in critical red. Also sets aria-invalid.
indeterminate
boolean | undefinedfalseWhen true, overrides checked to render a dash indicator (indeterminate state). This is useful for "select-all" patterns where a subset of children are checked.
label
ReactNodeVisible label rendered to the right of the indicator. Clickable — links to the control.
onCheckedChange
((checked: boolean | "indeterminate") => void) | undefinedFired when the checked state changes.
required
boolean | undefinedMarks the field as required. Sets aria-required.
size
"sm" | "md" | "lg" | undefined"md"Visual and interaction size.
value
string | undefinedValue used when this Checkbox is nested inside a CheckboxGroup. The group reads this value to manage its string[] state.