Skip to main content

Common Examples

To use the ButtonToggle, pass a required label and control selection with React Aria’s isSelected and onChange. Use defaultSelected instead for uncontrolled selection. The kit forbids children.
A bare icon creates an icon-only toggle. label becomes its accessible name and tooltip. Use { icon, position } to show the label beside the icon.size is "medium", "small", or "xsmall". On coarse pointers, xsmall promotes to a 40×40 minimum touch target.

React Accessibility

  • React Aria provides keyboard, pointer, focus-visible, and selection behavior.
  • label is always required, including for icon-only toggles.
  • Use a short imperative label such as “Bold” or “List view.”
Last modified on August 28, 2026