compacto-ui

Search documentation

Jump to a page or a component.

ButtonGroup

Adjacent buttons as one connected control; touching borders merge.

server-safe

Preview

Installation

No install — ask an AI agent to copy this component from registry.json.

import { ButtonGroup, ButtonGroupSeparator, buttonGroupVariants } from "@/components/ui/button-group";

Notes

  • Server-safe.
  • Only the outer corners stay rounded; touching borders merge into a single hairline.
  • Nest a ButtonGroup inside another to space clusters apart instead of joining them.
  • Reach for ButtonGroupSeparator when the merged hairlines do not read as a split — most often between same-colored solid buttons, where there is no border contrast to collapse.

Props

The props worth knowing. Everything else passes straight through to the underlying element, including className, which is merged last so it always wins.

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Seam direction.