Checkbox

Binary on/off input. Supports indeterminate state, label, description, error state, two sizes, and group patterns.

import{ Checkbox } from "@pepulux/ui"

States — unchecked / checked / indeterminate / disabled

Sizes — sm / md

sm is 16px, md is 20px.

With description

Receive product news, tips, and promotions.
Get notified of login attempts and suspicious activity.
A summary of everything that happened in your workspace.

Error state

Red border communicates validation failure.

You must accept the terms to continue.

Controlled state

Fully controlled with useState.

Get weekly product updates.

State: false

Select all / indeterminate group

Parent checkbox drives indeterminate state when a subset of children are checked.

1 of 4 selected

Props

PropTypeDefaultDescription
labelstringLabel text displayed next to the checkbox
descriptionstringSupporting text below the label
size"sm" | "md""sm"Checkbox dimension — 16px (sm) or 20px (md)
indeterminatebooleanfalseDash icon for partial-selection state (overrides checked icon)
checkedbooleanControlled checked state
defaultCheckedbooleanfalseUncontrolled initial checked state
onChange(e: ChangeEvent<HTMLInputElement>) => voidChange handler
disabledbooleanfalseDisables interaction and dims the control
idstringCustom id; auto-generated if not provided
classNamestringApplied to the outer wrapper div