Skip to contentWolf-Rayet

Button group

A button group shows related actions together.

Install

One package and one stylesheet. The stylesheet holds the tokens every component uses.

pnpm add @wolf-rayet/react
import '@wolf-rayet/react/css/wolf-rayet.css';
import { ButtonGroup } from '@wolf-rayet/react';

Props

A required prop is marked with an asterisk.

PropTypeDefaultDescription
children *ReactNodeNoneThe buttons, in order. Put the primary button last.
labelstringNoneNames the group for assistive technology, as in Queue actions.
appearance'default' | 'primary' | 'subtle' | 'warning' | 'danger' | 'discovery' | 'link'NoneApplies one appearance to every button in the group. Leave it out when they differ.
spacing'default' | 'compact'NoneCompact for a dense row.

Accessibility

What the component does for you, and what it needs from you.

  • The group name lets a screen reader announce the buttons as one set of related actions.
  • The order in the markup sets the tab order, so keyboard users move through the buttons in the order they see them.