---
title: "Button Group"
description: "Joins related buttons into one connected control, horizontally or vertically, with separators and text, for toolbars and split buttons."
plan: Free
docs: https://ui.edbn.me/docs/components/button-group
---

# Button Group

Joins related buttons into one connected control, horizontally or vertically, with separators and text, for toolbars and split buttons.

## Installation

```bash
npx shadcn@4.19.0 add https://ui.edbn.me/r/button-group.json
```

## Dependencies
- npm: @base-ui/react@^1.8.0, class-variance-authority@^0.7.1
- edbn: edbn-base, separator

## Usage

```tsx examples/button-group-basic.tsx
"use client";
import { MoreHorizontal } from "lucide-react";
import { Button } from "@/components/ui/button";
import {
  ButtonGroup,
  ButtonGroupSeparator,
} from "@/components/ui/button-group";

export default function ButtonGroupBasicPreview() {
  return (
    <ButtonGroup>
      <Button variant="outline">Save</Button>
      <ButtonGroupSeparator />
      <Button variant="outline" size="icon" aria-label="More options">
        <MoreHorizontal />
      </Button>
    </ButtonGroup>
  );
}
```

## Files
- components/ui/button-group.tsx (88 lines)

## For agents
- Base theme, once per project: npx shadcn@4.19.0 add https://ui.edbn.me/r/edbn-base.json
- MCP server with search, items, examples and source: https://ui.edbn.me/mcp
- Every page and item: https://ui.edbn.me/llms.txt
