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
labelstring—Label text displayed next to the checkbox
descriptionstring—Supporting text below the label
size"sm" | "md""sm"Checkbox dimension — 16px (sm) or 20px (md)
indeterminatebooleanfalseDash icon for partial-selection state (overrides checked icon)
checkedboolean—Controlled checked state
defaultCheckedbooleanfalseUncontrolled initial checked state
onChange(e: ChangeEvent<HTMLInputElement>) => void—Change handler
disabledbooleanfalseDisables interaction and dims the control
idstring—Custom id; auto-generated if not provided
classNamestring—Applied to the outer wrapper div
Base component → Checkboxeswww.pepulux.com

Notes and documentation

Space for notes, documentation, and best practices for using these components.

Independent yes / no choices

Use checkboxes when a person can select any number of options, or to confirm a single statement. The indeterminate state shows that some — but not all — children are selected.

Click targets include the label, so keep labels short and clear.

Do

  • Phrase labels positively

Don't

  • Use checkboxes for mutually exclusive choices — use radio buttons