Toggle Group

Form Controls
Local guide ↗ import { ToggleGroup } from "bits-ui"

Single selection

type="single" models mutually exclusive alignment with a string value

Alignment: left

Multiple selection

type="multiple" keeps independent text formats in a string array

Ship precise interfaces, not piles of configuration.

Active: bold, underline

type is required and forms a discriminated union: "single" binds a string while "multiple" binds a string array. Each item exposes data-state="on|off" for pressed styling.

The root defaults to horizontal orientation, looping arrow navigation, and roving focus. Set orientation, loop, or rovingFocus to change those keyboard semantics. Toggle Group has no name or required props and does not create hidden form inputs; serialize its bound value separately when submitting a form.