Copy to clipboard
Installation
Copy to clipboard
npx bearnie add toggle
npx bearnie add toggle
bunx bearnie add toggle
bunx bearnie add toggle
pnpm dlx bearnie add toggle
pnpm dlx bearnie add toggle
yarn dlx bearnie add toggle
yarn dlx bearnie add toggle
Copy to clipboard
import Toggle from "@/components/ui/toggle/Toggle.astro";
Usage
import { Toggle } from "@/components/ui/toggle"
<Toggle>Toggle</Toggle>
Examples
Outline
Copy to clipboard
With text
Copy to clipboard
Sizes
Copy to clipboard
Pressed
Copy to clipboard
Disabled
Copy to clipboard
Anatomy
Toggle- A pressable button that toggles between on and off states
Props
Toggle
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | ”default” | “outline" | "default” | Visual style variant |
| size | ”sm” | “default” | “lg" | "default” | Size of the toggle |
| pressed | boolean | false | Initial pressed state |
| disabled | boolean | false | Disables the toggle |
| class | string | - | Additional CSS classes |