bearnie

Toggle

A two-state button that can be either on or off.

Installation

npx bearnie add toggle
npx bearnie add toggle

Usage

import { Toggle } from "@/components/ui/toggle"
<Toggle>Toggle</Toggle>

Examples

Outline

With text

Sizes

Pressed

Disabled

Anatomy

  • Toggle - A pressable button that toggles between on and off states

Props

Toggle

PropTypeDefaultDescription
variant”default” | “outline""default”Visual style variant
size”sm” | “default” | “lg""default”Size of the toggle
pressedbooleanfalseInitial pressed state
disabledbooleanfalseDisables the toggle
classstring-Additional CSS classes