Skip to content
RivetUI

Switch

Toggles a setting that takes effect immediately.

@rivetui/switch

Preview

Explore each composition interactively, then open its code in the same context.

With supporting text

Place the immediate setting beside a clear label and concise consequence.

Route traffic to a healthy region when the primary is unavailable.

States

On, off, and disabled switches retain a consistent target and alignment.

Validation

Use semantic invalid state and a connected error when a switch is required.

Registry

Installation

Add the component source and its declared dependencies with the shadcn CLI.

Install component
bunx --bun shadcn@latest add @rivetui/switch
Inspect registry item

Public interface

API reference

Component-specific props are listed here. Native element and Base UI props continue to pass through.

PropTypeDefault
checkedboolean—
defaultCheckedbooleanfalse
onCheckedChange(checked: boolean, details) => void—
disabledbooleanfalse
Rivet UI / SwitchComponents engineered, not decorated.