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

PropTypeDefaultRequiredDescription
checkedbooleanNoThe controlled checked state of the toggle.
defaultCheckedbooleanNoThe default checked state when uncontrolled.
onCheckedChange(checked: boolean) => voidNoCallback fired when the checked state changes.
disabledbooleanNoWhether the toggle is disabled.
variant"default" | "error""default"NoThe visual variant of the toggle.
size"xs" | "sm" | "default""default"NoThe size of the toggle.
aria-labelstringNoOptional 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