Forms/ToggleGroup

ToggleGroup

A segmented group of toggle buttons. Supports single selection, like a radio group, or multiple selection, like independent toolbar toggles.

import { ToggleGroup, ToggleGroupItem } from "@animui/ui"

Single selection

Multiple selection

Disabled item

ToggleGroup Props

PropTypeDefaultDescription
type"single" | "multiple"Whether one or multiple items can be active at a time.
valuestring | string[]Controlled active value(s). String for single, string array for multiple.
defaultValuestring | string[]Uncontrolled initial active value(s).
onValueChange(value: string | string[]) => voidCalled when the active value(s) change.
childrenReact.ReactNodeToggleGroupItem elements.
classNamestringAdditional classes for the group wrapper.

ToggleGroupItem Props

PropTypeDefaultDescription
valuestringUnique value identifying this item within the group.
childrenReact.ReactNodeContent rendered inside the item.
disabledbooleanfalsePrevents interaction and applies reduced opacity.
classNamestringAdditional classes for the item button.

Accessibility

  • The group is exposed with role="group".
  • Each item is a native <button> with aria-pressed.
  • Disabled items are removed from the tab order.
© 2026 Steal Shadow. MIT License.Report an issue