If the user does not trigger an action but picks one of several options, use CdsButtonToggle — it keeps the selected state.
Variations
The group passes the variant, color, base-color and size props down to every button inside — you do not need to repeat them on each button. A prop set on the button itself takes precedence over the group value.
Variant and color
variant and color set the look of every button in the group — from a filled solid for the main set of actions to color="inverse" for dark backgrounds. The deprecated appearance still works and resolves into the same pair as on CdsButton.
Sizes
size changes the height and padding of all buttons at once, so a group in a filter bar and a group in a table header stay consistent.
Color
color paints the button background with a palette alias. Use status colors when the whole group leads to one outcome — accept or reject.
Dividers and direction
Without divided the buttons sit flush against each other; with it a line appears between them, so neighboring actions do not blend together. direction="vertical" turns the group into a column — for zoom controls on a map, for example.
API
Props
| Name | Type | Default | Description |
|---|---|---|---|
appearancedeprecated | "inverse" | "primary" | "secondary" | "tertiary" | "transparent" | undefined | — | Visual appearance of the component. Deprecated: use variant and color |
baseColor | string | undefined | — | Color of the component in its inactive state |
color | (string & {}) | "neutral" | "brand" | "accent" | "danger" | "inverse" | undefined | 'brand' | Component color: a role, a palette alias, a theme token or a CSS color |
direction | "horizontal" | "vertical" | undefined | 'horizontal' | Switches the component between horizontal and vertical layout. |
divided | boolean | undefined | — | Adds dividers between the buttons of the group. |
size | number | "xs" | "sm" | "md" | "lg" | "xl" | undefined | 'md' | Size of the component |
tag | string | JSXComponent<any> | undefined | 'div' | Custom HTML tag or component to render |
theme | string | undefined | — | Component theme |
variant | "solid" | "soft" | "outline" | "surface" | "ghost" | undefined | 'solid' | Component variant: solid, soft, outline, surface, ghost |
Slots
| Name | Type | Description |
|---|---|---|
default | any | Buttons of the group. |