0
Components
API reference

Switch

A tactile Material 3 toggle switch with dynamic thumb scaling, optional state icons, and three size presets.

Installation

Usage

Examples

Checked Icon

Both Icons

Small

Large

Disabled

In Card

API Reference

Switch

Wraps Base UI Switch.Root and Switch.Thumb with Material 3 thumb scaling and optional icons.

PropTypeDefaultDescription
icons"checked" | "both"-"checked" shows a check when on; "both" also shows an × when off
size"sm" | "default" | "lg""default"Overall track and thumb size preset
checkedboolean-Controlled checked state
defaultCheckedbooleanfalseInitial uncontrolled checked state
onCheckedChange(checked: boolean) => void-Called when the checked state changes
disabledbooleanfalseDisables interaction and dims the switch
classNamestring-Additional CSS classes
...propsBase UI Switch Root props-All standard switch attributes (name, value, required, etc.)

© taut ui — built with Base UI and Tailwind CSS v4.