Skip to content

Toggle

A two-state button that can be either on or off.

Install

Bash
npx @madeui/cli add toggle

Usage

TSX
import { Toggle } from '@/components/ui/toggle';

Outline

With text

Sizes

Disabled

API reference

Built on Base UI Toggle. The table below covers the props this library adds — every other prop (pressed, defaultPressed, onPressedChange, disabled, …) is forwarded; see the Base UI Toggle API reference.

PropTypeDefaultDescription
variant'default' | 'outline''default'
size'sm' | 'md' | 'lg''md'
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

Was this page helpful?