Switch

A toggle switch component for binary on/off states, often used for settings and preferences.

Installation

npx chilli@latest add switch

Default

API Reference

Switch

PropTypeDefaultDescription
labelstringThe label text for the switch.
checkedbooleanControlled checked state.
defaultCheckedbooleanfalseInitial checked state for uncontrolled usage.
disabledbooleanfalseWhether the switch is disabled.
onCheckedChange(checked: boolean) => voidCallback when the checked state changes.