Active segment
Mix .btn-primary with glass siblings for the selected option.
Segmented glass control wrapping related buttons — mark the active segment with primary (or leave siblings as glass / ghost).
Live
<div class="btn-group" role="group" aria-label="View density">
<button type="button" class="btn btn-compact">Comfortable</button>
<button type="button" class="btn btn-compact btn-primary">Compact</button>
<button type="button" class="btn btn-compact">Dense</button>
</div>
import { Button, ButtonGroup } from 'caustica-design/core'
<ButtonGroup aria-label="View density">
<Button compact>Comfortable</Button>
<Button variant="primary" compact>Compact</Button>
<Button compact>Dense</Button>
</ButtonGroup>
Mix .btn-primary with glass siblings for the selected option.
Ghost and default buttons sit flush inside the pill chrome.
Prefer .btn-compact so segments fit dense toolbars.
aria-label (or aria-labelledby).
role="group" on the wrapper (React
ButtonGroup sets this for you).
<button> elements — not links styled as
buttons.
disabled; focus still moves to enabled
siblings.
| Class | Description |
|---|---|
.btn-group |
Segmented glass wrapper; children are .btn elements. |
.btn (child) |
Button segments — radius and shadow reset inside the group. |
.btn-primary / .btn-ghost / .btn-danger |
Variant modifiers on children (same as Button). |
.btn-compact |
Recommended on segments for dense groups. |
From src/core/ButtonGroup.tsx — extends
HTMLAttributes<HTMLDivElement>.
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label |
string |
— | Required accessible name for the group. |
children |
ReactNode |
— | Typically Button children. |
className |
string |
— | Merged via cx onto .btn-group. |