Components › Actions
Toggle
A two-state button for formatting and view options.
Installation
npx plankui@latest add toggleUsage
import { Toggle } from "@/components/ui/toggle";
<Toggle aria-label="Bold"><Bold /></Toggle>API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| pressed / defaultPressed | boolean | State. | |
| onPressedChange | (pressed: boolean) => void | Called on toggle. | |
| variant | "ghost" | "outline" | "ghost" | Visual style. |
| size | "sm" | "md" | "lg" | "md" | Height. |