Button Group

Buttons and fields joined into one control, like the + and − buttons under a list.

@cupertinoui/button-groupRegistry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/button-group

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

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

<ButtonGroup>
  <Button variant="secondary" size="icon"><PlusIcon /></Button>
  <Button variant="secondary" size="icon"><MinusIcon /></Button>
</ButtonGroup>

API Reference

Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.

ButtonGroup

PropTypeDescription
orientation"horizontal" | "vertical"
Default: "horizontal"
How the buttons are joined.
classNamestringExtra classes, merged with the component's own.

ButtonGroupText / ButtonGroupSeparator

PropTypeDescription
classNamestringExtra classes, merged with the component's own.