Search documentation
Search pages, components, blocks, styles and colours.
A control that allows the user to toggle between checked and not checked.
Installation
Usage
import { Switch } from "@/components/ui/switch"<Switch />Description
Focus is shared across devices, and turns off when you leave the app.
Choice Card
Card-style selection where FieldLabel wraps the entire Field for a clickable card pattern.
Receive notifications when focus mode is enabled or disabled.
Disabled
Add the isDisabled prop to the Switch component to disable the switch. Add the data-disabled prop to the Field component for styling.
Invalid
Add the data-invalid prop to the Switch component to indicate an invalid state. Add the data-invalid prop to the Field component for styling.
You must accept the terms and conditions to continue.
Size
Use the size prop to change the size of the switch.
API Reference
See the React Aria Switch documentation.