Elements Toggle
Back to Elements

Toggle

0 components

UI elements you can copy into your project.

API reference

Generated from each primitive's $props() declaration.

Toggle.Root

Toggle button with dark mode support.

Prop Type Default Description
ref bind: HTMLElement | null null
pressed bind: boolean false
class as className string
size "default" | "sm" | "lg" "default"
variant "default" | "outline" "default"
...restProps Record<string, unknown> Remaining attributes, spread onto the underlying element.