Skip to content
UI

Search docs

Search components and documentation

New
Menu

Button Group

Groups related buttons together edge-to-edge, horizontal or vertical.

https://

Installation

npx logic2b@latest add button-group

Usage

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

<ButtonGroup>
  <Button variant="outline">Copy</Button>
  <Button variant="outline">Paste</Button>
</ButtonGroup>

<ButtonGroup>
  <ButtonGroupText>https://</ButtonGroupText>
  <ButtonGroupSeparator />
  <Button variant="outline">example.com</Button>
</ButtonGroup>

API

Prop Type Default
orientation (ButtonGroup) horizontal | vertical horizontal
orientation (ButtonGroupSeparator) horizontal | vertical vertical
asChild (ButtonGroupText) boolean false

All three parts also forward the native props of the element they render (ButtonGroup and ButtonGroupText render a <div>; ButtonGroupSeparator renders a Separator).

Examples

Vertical

With an input