Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
Forms
Component switch-demo not found in registry.
Installation
pnpm dlx createui@latest add switch
Usage
import { Switch } from "@/components/ui/switch"<Switch />Examples
Description
Component switch-description not found in registry.
Choice Card
Card-style selection where FieldLabel wraps the entire Field for a clickable card pattern.
Component switch-choice-card not found in registry.
Disabled
Add the disabled prop to the Switch component to disable the switch. Add the data-disabled prop to the Field component for styling.
Component switch-disabled not found in registry.
Invalid
Add the aria-invalid prop to the Switch component to indicate an invalid state. Add the data-invalid prop to the Field component for styling.
Component switch-invalid not found in registry.
Size
Use the size prop to change the size of the switch.
Component switch-sizes not found in registry.
API Reference
See the Base UI Switch documentation.