UIIcons

Toggle

A two-state button that can be pressed or unpressed, commonly used for formatting controls.

Installation

pnpm dlx stera-ui@latest add toggle

Variants

VariantDescription
defaultNo border, background appears on hover/press
outlineBordered with a surface background

With Text

Sizes

SizeDescription
xsExtra small
smSmall
mdMedium (default)
lgLarge
iconSquare icon button
icon-xsExtra small icon button
icon-smSmall icon button
icon-lgLarge icon button

Disabled

API Reference

Built on Base UI's Toggle primitive — see the full API reference there.

PropTypeDefault
variant"default" | "outline""default"
size"xs" | "sm" | "md" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg""md"
pressedboolean
defaultPressedboolean
onPressedChange(pressed: boolean) => void
disabledbooleanfalse