Forms and selection · stable · MIT

Button Group

Related native buttons joined by quiet shared material.

Install editable source

Add Button Group

Base UI / canonicalnpx shadcn@latest add https://gummyui.dev/r/gummy-button-group.json

No package dependency beyond React. Shared Gummy material is resolved automatically.

Behavior contract

Semantics before surface

Semantics

A labelled group with real buttons and optional separators or text.

Keyboard

Tab reaches each enabled button.

System support

Light and dark themes, logical RTL layout, reduced motion, responsive content, and forwarded public refs.

Source-derived reference

Anatomy and public API

Exported anatomy

These public React parts are read directly from the canonical source during the documentation build.

  • GummyButtonGroup
  • GummyButtonGroupSeparator
  • GummyButtonGroupText

Prop contracts

GummyButtonGroupProps

Composes React.HTMLAttributes<HTMLDivElement> & { label: string; orientation?: "horizontal" | "vertical"; attached?: boolean; }

GummyButtonGroupTextProps

Composes React.HTMLAttributes<HTMLSpanElement>

Troubleshooting

Check behavior before surface.

Implementation decisions

When to use Button Group

Use a button group when actions are closely related and benefit from shared placement; unrelated primary decisions should remain separate. Labels must describe each result without depending on icon recognition or position. Decide how focus and wrapping behave at small widths, and keep destructive actions visually and semantically distinct. Test loading, disabled, permission-denied, and partial-success states so grouped controls do not imply an action completed.

Live product source

Inspect the canonical states

The Component Lab exercises real source across default, focus, disabled, responsive, dark, reduced-motion, and RTL contexts.

Open the live Component Lab

Interactive inspection

Try Button Group in context

Load the real component preview when you are ready to interact with its responsive, theme, and direction controls.

Editable source

Read before you install

Canonical Base UI or native source

The registry payload stays off the initial page request.