Switch

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

API Reference
Loading...
Loading code...

Installation

pnpm dlx shadcn@latest add @uitopia/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.

Disabled

Loading...
Loading code...

With Description

Loading...
Loading code...

Card Style

Loading...
Loading code...

Form Integration

Loading...
Loading code...

Comparing with Radix / shadcn

If you’re already familiar with Radix UI and shadcn/ui, this guide highlights the small differences and similarities so you can get started with ui/topia quickly.

Quick Checklist

  • If you used asChild on parts, switch to the render prop