Skip to content

Button Group

Groups related action buttons into a labelled role="group", optionally joined into one segmented bar.

<script>
import ButtonGroup from "@invisible-ui/svelte/ButtonGroup.svelte";
</script>

In Elements:

<ds-button-group label="Text alignment">
<ds-button>Left</ds-button>
<ds-button>Center</ds-button>
<ds-button>Right</ds-button>
</ds-button-group>
PropTypeDefaultDescription
label *string—Accessible name for the group.
orientationOrientation"horizontal"Layout direction.
attachedbooleantrueVisually merge the buttons into one bar.
align"start" | "center" | "end" | "stretch""center"Cross-axis alignment of the items. Defaults to center so a taller sibling (e.g. a Select with a label) never stretches the buttons; use end to line buttons up with a labelled control's input row, or stretch for equal heights.
  • Renders a labelled role="group" with aria-orientation.
  • Holds no selection — each button stays an independent action and tab stop.
<ButtonGroup label="Text alignment">
<Button>Left</Button>
<Button>Center</Button>
<Button>Right</Button>
</ButtonGroup>

In React, the buttons are the children, and align sets their cross-axis alignment:

<ButtonGroup label="Text alignment" align="end">
<Button>Left</Button>
<Button>Center</Button>
<Button>Right</Button>
</ButtonGroup>

Themeable via --ds-button-group-*.