Switch

StepperTable

Controlled or uncontrolled, with labels.

Get notified about new activity.

Product news and offers.

Installation

pnpm add krz-ui

Usage

import { Switch } from "krz-ui";
<Switch label="Notifications" checked={on} onCheckedChange={setOn} />

API Reference

PropTypeDescription
checked / defaultCheckedbooleanControlled or initial state.
onCheckedChange(checked: boolean) => voidCalled when toggled.
label / descriptionReactNodeText next to the switch.
size"sm" | "md" | "lg"Switch size.
className / style / ref—className and style go on the outer element (the switch itself when there's no label); ref and native attributes go to the switch button. See Customization.
classNames{ track?, thumb?, label?, description? }Extra classes for inner parts.