Switch

A control that indicates whether a setting is on or off.

API Reference

Installation

pnpm dlx cnippet@latest add switch

Usage

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

Examples

For accessible labelling and validation, prefer using the Field component to wrap checkboxes. See the related example: Switch field.

With Description

Card Style

Form Integration