React Selection Controls

Checkbox, RadioGroup, and Switch — built on real native inputs (visually hidden, mirrored by drawn controls via peer classes), so forms submit, labels click, screen readers announce, and keyboard focus behaves exactly like the platform. Checkbox supports the indeterminate parent-of-partial-selection state; radios and checkboxes take an optional description line; Switch uses role="switch".

Deliverables

Temperature grade

Build options

Installation

npx shadcn@latest add selection-controls.json

Usage

Loading...

Props

Checkbox / Switch

Native <input> attributes (checked, defaultChecked, onChange, disabled, …) plus:

PropTypeDefaultDescription
labelstringLabel rendered beside the control
descriptionstringSecondary line under the label
indeterminatebooleanfalseCheckbox only — mixed/partial state

RadioGroup

PropTypeDefaultDescription
namestringShared input name for the group
optionsRadioOption[]{ value, label, description?, disabled? }
valuestringSelected value
onChange(value: string) => voidSelection callback
labelstringAccessible group label