An on/off toggle built on a native checkbox with role="switch".
import { Switch } from "@kivu-ui/react"On this page
import { Switch } from "@kivu-ui/react";Anyone with the link can view project status.
import { Switch } from "@kivu-ui/react";
export default function Demo() {
return (
<div className="flex flex-col gap-4">
<Switch label="Two-factor sign-in" defaultChecked />
<Switch label="Public client portal" description="Anyone with the link can view project status." />
</div>
);
}Extends all <input type="checkbox"> attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | - | Clickable label. |
description | ReactNode | - | Helper text under the label. |
wrapperClassName | string | - | Class for the wrapper. |
Every component also accepts className and forwards its ref. Root CSS class: .kivu-switch