Introducing PrimeReact v11-alpha 🎉Discover Now
tailwindButton

ButtonGroup

ButtonGroup composes related buttons into a connected pill with shared corners and seams.

preview

Installation#

npx shadcn@latest add https://v11.primereact.org/r/buttongroup.json

Usage#

import { Button } from '@/components/ui/button';
import { ButtonGroup } from '@/components/ui/buttongroup';
<ButtonGroup>
    <Button>Save</Button>
    <Button>Cancel</Button>
</ButtonGroup>

Examples#

Basic#

A standard ButtonGroup wraps multiple buttons into a connected unit.

basic-demo

Icons#

Buttons inside a group support leading and trailing icons.

icon-demo

Severity#

Each button in a group can use a different severity to convey intent.

severity-demo

Raised#

Raised buttons display a shadow to indicate elevation.

raised-demo

Rounded#

Rounded buttons soften the outer corners of the group.

rounded-demo

Text#

Text buttons render as textual elements while keeping the connected layout.

text-demo

Outlined#

Outlined buttons display a border without a transparent background.

outlined-demo

Icon Only#

Icon-only buttons can be combined into compact toolbars and pickers.

icon-only-demo

Sizes#

ButtonGroup supports small and large sizes alongside the default.

size-demo

Disabled#

When disabled is present on each button, the group becomes non-interactive.

disabled-demo

Split Button#

Pair a primary action with a MenuTrigger button to expose related options without crowding the main action.

split-button-demo