Components › Actions

Toggle

A two-state button for formatting and view options.

Installation

npx plankui@latest add toggle

Usage

import { Toggle } from "@/components/ui/toggle";

<Toggle aria-label="Bold"><Bold /></Toggle>

API reference

PropTypeDefaultDescription
pressed / defaultPressedbooleanState.
onPressedChange(pressed: boolean) => voidCalled on toggle.
variant"ghost" | "outline""ghost"Visual style.
size"sm" | "md" | "lg""md"Height.

View the source on GitHub