Primitives

Button Group

The Button Group component visually groups related buttons into a single unit, with support for horizontal and vertical orientation, separators, and inline text.


Button Group Examples

Horizontal

Vertical

With Icons

With Separator and Text

v1.2.0

Installation

# The component is already installed at:
# src/components/ui/shadcn/button-group.tsx

Usage

import { Button } from '@/components/ui/shadcn/button'
import { ButtonGroup } from '@/components/ui/shadcn/button-group'

export function ButtonGroupDemo() {
  return (
    <ButtonGroup>
      <Button variant="outline">Left</Button>
      <Button variant="outline">Center</Button>
      <Button variant="outline">Right</Button>
    </ButtonGroup>
  )
}

Props

ButtonGroup

PropTypeDefaultDescription
orientationhorizontal | verticalhorizontalDirection the buttons are stacked

Components

ComponentDescription
ButtonGroupThe root container, merges adjacent borders and radii
ButtonGroupSeparatorA vertical or horizontal divider between buttons
ButtonGroupTextNon-interactive text or label rendered like a button
Previous
Button