Switch is used to toggle between two states on and off. It is commonly used in settings panel, forms and any other place where a user needs to enable or disable feature.

"use client"; import Switch from "@radui/ui/Switch"; export default function SwitchExample() { return <Switch.Root> <Switch.Thumb /> </Switch.Root>; }

Root component for the Switch component.

PropTypeDefault

children

React.ReactNodenull

customRootClass

string''

Thumb component for the Switch component.

PropTypeDefault

asChild

boolean

false

customThumbClass

string''