ButtonGroup

Actions

Buttons joined into one control. <ButtonGroup.Root> (orientation: horizontal or vertical) holds Buttons, triggers, an Input, a ButtonGroup.Text (a label or unit in a box) and ButtonGroup.Separators, and joins them: square inner corners, one border between neighbours. It is a group; name it with aria-label. Groups inside a group keep a gap.

import { ButtonGroup } from '@limerdev/zest';
ButtonGroup for AI tools (llms.txt)
Use for
A split button (an action and a menu of its variants), a pager (Previous, Next), a zoom control, a toolbar segment, an input with its action.
Don't
Choosing one of several options: use ToggleGroup. A row of unrelated actions: put Buttons side by side with a gap. Tabs between views: use Tabs.

Examples

Split button

A split button: the action, and a menu of its other ways.

Pager

Outline buttons with ButtonGroup.Text between them: one border between neighbours.

Page 2 of 5

With input

An Input and its action, joined. Groups inside a group keep a gap.

Vertical

orientation="vertical" stacks the buttons.

Props

Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that renders your own element, with props to spread on it).

ButtonGroup.Root

Prop Type Default Description
orientation "horizontal" | "vertical" 'horizontal' Which way the buttons run: side by side, or stacked.

ButtonGroup.Text

No props of its own beyond the common ones.

ButtonGroup.Separator

Prop Type Default Description
decorative boolean true Whether the separator is decorative and should be hidden from assistive technologies.
orientation "horizontal" | "vertical" 'vertical' The orientation of the separator.