Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Checkbox

Select individual records or the whole set.

Preview

Live preview

Changes apply to this preview only.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Sizes

sm, md and lg.

Open preview

Variants

The color of the checked box.

Open preview

States

Unchecked, checked, mixed, disabled, required and described.

Open preview

Usage

Compute the mixed state from the selected records and keep the application dataset authoritative.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluCheckboxProps

Type source
PimoluCheckboxProps public API
NameTypeDefaultDescription
size"sm" | "md" | "lg" | undefined"md"Size of the checkbox.
variant"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined"primary"Semantic color when checked.
labelstring | undefined—Visible accessible label.
descriptionstring | undefined—Additional description.
indeterminateboolean | undefinedfalseShow the mixed state.
onCheckedChange((checked: boolean) => void) | undefined—Called with the new checked value.
onChangeChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLInputElement> | undefined—Standard React/HTML attribute.
disabledboolean | undefinedfalseStandard React/HTML attribute.
namestring | undefined—Standard React/HTML attribute.
valuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
requiredboolean | undefinedfalseStandard React/HTML attribute.
size

"sm" | "md" | "lg" | undefined

Default: "md"

Size of the checkbox.

variant

"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined

Default: "primary"

Semantic color when checked.

label

string | undefined

No default extracted.

Visible accessible label.

description

string | undefined

No default extracted.

Additional description.

indeterminate

boolean | undefined

Default: false

Show the mixed state.

onCheckedChange

((checked: boolean) => void) | undefined

No default extracted.

Called with the new checked value.

onChange

ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onClick

MouseEventHandler<HTMLInputElement> | undefined

No default extracted.

Standard React/HTML attribute.

disabled

boolean | undefined

Default: false

Standard React/HTML attribute.

name

string | undefined

No default extracted.

Standard React/HTML attribute.

value

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

required

boolean | undefined

Default: false

Standard React/HTML attribute.

Accessibility

  • Provide visible labels and verify the indeterminate state with a screen reader.
Read the accessibility guide →