Ballmac UI home

Button Group

Join adjacent actions into one compact control surface while retaining each button's visible keyboard focus and accessible name.

Q3 product brief

Last edited a few minutes ago

Share

Ready to share

Installation

$ pnpm dlx shadcn@latest add @ballmac/button-group

Usage

import { ButtonGroup, ButtonGroupText, ButtonGroupSeparator } from "@/components/ballmac/button-group"

The full example is in the Code tab above.

Examples

Orientations

100%

Vertical groups keep related tools compact in narrow panels.

API reference

PropTypeDefault
orientation

Direction of adjacent controls.

"horizontal" | "vertical""horizontal"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabMoves between each button in document order
Enter / SpaceActivates the focused button

Use with AI

Groups closely related actions without turning them into a selection widget. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Button Group (@ballmac/button-group) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Adjacent document or editor actions
  • Compact controls with one shared boundary

Not for

  • Mutually exclusive options; use toggle-group
  • Unrelated actions

Registry JSON: https://ui.ballmac.com/r/button-group.json

Credits

Free to use in personal and commercial projects.

npm
None
Registry
shadcn/utils