Design System
Buttons

Toggle

A two-state button that stays pressed. Use it for a setting that takes effect immediately, not as a substitute for a checkbox in a form.

Not documented yet

This component ships in the design system and is fully supported. What is missing is the guidance around it: when to reach for it, the do and don't, and the accessibility notes. Until that is written, Storybook is the reference for variants, props and live controls.

Props

PropTypeDefaultDescription
asChildboolean | undefined
pressedboolean | undefinedThe controlled state of the toggle.
defaultPressedboolean | undefinedfalseThe state of the toggle when initially rendered. Use `defaultPressed` if you do not need to control the state of the toggle.
onPressedChange((pressed: boolean) => void) | undefinedThe callback that fires when the state of the toggle changes.
variant"default" | "outline" | null | undefined
size"default" | "sm" | "lg" | null | undefined

On this page