bearnie

Switch

Toggle between on and off states.

Installation

npx bearnie add switch
npx bearnie add switch

Usage

import { Switch } from "@/components/ui/switch"
<Switch id="mode" />

Examples

Checked

Disabled

With description

Receive emails about new products and updates.

Anatomy

  • Switch - A single toggle element

Props

Switch

PropTypeDefaultDescription
idstring-Element ID for label association
namestring-Form field name
checkedbooleanfalseDefault checked state
disabledbooleanfalseDisables the switch
classstring-Additional CSS classes