Skip to content

Button Group ​

SButtonGroup joins several SButton into one control: attached buttons share their edges, and the appearance props set on the group (size, variant, color, square, round, disabled) become the defaults of every button inside, so a button that sets the prop itself still wins. The root carries role="group"; give it a label when the set of actions needs a name of its own.

Attached buttons ​

Shared appearance ​

The group props reach every button. Here the whole group is outline and sm, while the last button sets its own variant.

Vertical and detached ​

orientation="vertical" stacks the buttons. :attached="false" keeps every button's own shape and spaces them out instead.

Shape and color ​

round and square apply to the whole group: the outer corners follow the button shape, the inner ones always collapse. color takes a name from the palette.

API ​

Props

NameTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Direction the buttons are laid out in: side by side or stacked.
attachedbooleantrueButtons share an edge: inner corners are flattened and neighbouring borders collapse into a single line. Turn it off to keep each button's own shape and space them out instead.
labelstringundefinedAccessible name of the group (aria-label). Without it the group stays unnamed.
size"md" | "sm" | "lg"undefinedSize of every button in the group; a size set on a button itself wins.
variant | "primary" | "secondary" | "negative" | "outline" | "ghost"undefinedVariant of every button in the group; a variant set on a button itself wins.
colorstringundefinedAccent color of every button in the group: a name from the palette (primary/teal/teal-10). A color set on a button itself wins.
squarebooleanundefinedSquare corners on every button in the group; a square set on a button itself wins.
roundbooleanundefinedPill shape on every button in the group; a round set on a button itself wins.
disabledbooleanundefinedDisables every button in the group; a disabled set on a button itself wins.

Slots

NameDescription
defaultButtons of the group (SButton).