Components

Switch

forms

Toggle switch for boolean settings with error state support. Accessible, keyboard navigable, with smooth animations. Built on Radix UI primitives for consistent behavior.

@launch/ui

Live Preview

Basic

Basic Switch

Simple on/off toggle with label

Notifications are enabled

States

Error State

Switch with error styling

Unable to save preference. Please try again.

Disabled States

Switches in disabled state

Real World

Settings Panel

Multiple switches with descriptions

Enable dark theme across the application

Automatically save changes as you work

Usage Guidance

✓ When to Use

Use for binary settings and preferences: enable/disable features, dark mode toggle, notification settings, privacy controls. Best for immediate effect toggles.

✗ When NOT to Use

Don't use for form submissions (use Checkbox), multiple selections (use Checkbox group), or actions that require confirmation (use Button with modal).

Props

errorclassNamestylechildrenonClickonChange

Tags

switch
toggle
boolean
settings
accessibility
radix-ui
validation