GitHubGitHub
← All components
Actions / component

Button group

A segmented toolbar wrapper that fuses adjacent buttons into one control with shared hairline borders.

SegmentedSplit action
<ButtonGroup label="View options">  <Button variant="ghost">Day</Button>  <Button variant="ghost">Week</Button></ButtonGroup>

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { ButtonGroup } from '@chanrg/4ui';<ButtonGroup label="View options">  <Button variant="ghost">Day</Button>  <Button variant="ghost">Week</Button></ButtonGroup>

API reference

Props

PropTypeDefaultDescription
labelstringAccessible name for the group.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Renders role="group" with an accessible label; each button keeps its own semantics.

Dependencies

Button