Toggle
Switch control for binary on/off state.
Import/Installation
import { Label, Toggle } from "@lottiefiles/creator-plugins-ui";Preview
Usage
<div className="flex items-center gap-2">
<Toggle checked={enabled} onCheckedChange={setEnabled} aria-label="Enable snap" />
<Label variant="inline">Enable snapping</Label>
</div>Props
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| checked | boolean | — | No | The controlled checked state of the toggle. |
| defaultChecked | boolean | — | No | The default checked state when uncontrolled. |
| onCheckedChange | (checked: boolean) => void | — | No | Callback fired when the checked state changes. |
| disabled | boolean | — | No | Whether the toggle is disabled. |
| variant | "default" | "error" | "default" | No | The visual variant of the toggle. |
| size | "xs" | "sm" | "default" | "default" | No | The size of the toggle. |
| aria-label | string | — | No | Optional aria-label. Required if no visible label is provided. |
Built on Base UI Switch. See their docs for primitive-level details.
Last updated: August 5, 2026 at 11:47 AMEdit this page