Skip to content

Switch

A toggle switch for binary settings. Accessible and keyboard-operable. Built on Radix UI Switch.

$cookest-ui add switch

Basic

A simple switch with a label.

Settings Panel

Use switches in a settings list for multiple boolean toggles.

Get notified when your meal plan is ready

Receive seasonal recipes every Monday

Use the dark theme across the app

Let Cookest suggest meals based on your history

PropTypeDefaultDescription
checkedbooleanControlled checked state of the switch.
onCheckedChange(checked: boolean) => voidCallback when the switch is toggled.
defaultCheckedbooleanfalseDefault state for uncontrolled usage.
disabledbooleanfalsePrevents interaction when true.
idstringID for pairing with a Label element.