Skip to content
Theme

Toggle button

A button that stays on or off.

Examples

Off and on

Props

ToggleButton

A button that stays on or off, announced as pressed or not pressed.

PropTypeDefaultDescription
size?"sm" | "md""md"
childrenReactNode—

Also takes 102 props it passes to the underlying React Aria component or element (events, ARIA attributes, state such as isDisabled), documented by React Aria.

Keyboard

KeyDoes
Enter or SpaceToggles it

Accessibility

  • Announced as pressed or not pressed (aria-pressed).