Components/Switch

Switch

A control for turning a single setting on or off.

Interactive example

Installation

Run the CLI from your project root. Dependencies and component source are added automatically.

$npx quackelements add switch

Usage

The generated file lives in your repository, so the component API and styles remain fully editable.

example.tsx
import { Switch } from "@/components/quack/switch"

export function SwitchDemo() {
  return (
    <label className="flex items-center justify-between gap-8">
      <span>Product updates</span>
      <Switch defaultChecked />
    </label>
  )
}