Skip to content

Commit 82bcf92

Browse files
committed
docs(button-group): add ux docs
1 parent 7448798 commit 82bcf92

File tree

9 files changed

+103
-2
lines changed

9 files changed

+103
-2
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Button groups
2+
3+
A **button group** visually connects multiple related buttons into a single, unified control.
4+
It helps users recognize that the buttons belong to the same context or task area.
5+
6+
## Usage ---
7+
8+
Button groups can contain standard buttons that perform **actions**, or **selection** buttons that represent modes or states.
9+
10+
### Action button group
11+
12+
An **action button group** organizes related commands that belong to the same workflow or functional area.
13+
Each button performs its own action, and several buttons can be used in sequence.
14+
15+
![Button group](images/button-group.png)
16+
17+
An action button group is a simple row of independent buttons with no collapsing or overflow menu.
18+
Unlike the [content action bar](../buttons-menus/content-actions.md), a unified responsive menu bar treated as one navigable unit,
19+
each button in a button group receives focus individually when tabbing.
20+
21+
Use it for 2–4 direct, peer-level actions (e.g., Expand/Collapse)
22+
when distinct focus and a fixed layout are required instead of unified menu behavior.
23+
24+
### Split button
25+
26+
A **split button** combines a primary action with a secondary dropdown of related options.
27+
It is useful when one action is the default or most common, but additional alternatives are available.
28+
29+
Use it to provide a quick “default” action while still offering variations (e.g., Save / Save as…)
30+
31+
![Split button](images/button-group-split.png)
32+
33+
### Selection button
34+
35+
A **selection button** is used for switching between views, modes, or states, rather than executing direct actions.
36+
The group visually connects related choices and communicates a selection state instead of triggering independent commands.
37+
38+
![Selection buttons](images/button-group-selection.png)
39+
40+
It supports both single and multi-selection, depending on the context:
41+
42+
- **Single selection:** only one option can be active at a time (radio behavior),
43+
e.g., switching between different views such as `All`, `Read` and `Unread`.
44+
- **Multi-selection:** several options can be active simultaneously (checkbox behavior),
45+
e.g., filtering by `Temperature`, `Pressure`, and `Voltage`.
46+
47+
![Selection button](images/button-group-selection-modes.png)
48+
49+
### Best practices
50+
51+
- For binary options, such as `yes/no` or `on/off` use a [switch](../forms-inputs/switch.md) component.
52+
- If there are more than five options or not enough horizontal space, use
53+
the [select](../forms-inputs/select.md) component.
54+
- For multi-select scenarios with unrelated options, prefer the
55+
[checkbox](../forms-inputs/checkbox.md) component.
56+
- When switching between distinct content areas, such as sub-pages, use
57+
[tabs](../layout-navigation/tabs.md) component.
58+
- Labels should be nouns or noun phrases that succinctly describe
59+
the action or choice. Do not wrap the text over multiple lines.
60+
61+
## Design ---
62+
63+
### Variants
64+
65+
Button group supports label+icon, label only and icon only.
66+
67+
![Button group variants](images/button-group-variants.png)
68+
69+
### Styles
70+
71+
The **action button group** and **split button**, inherits the same visual style and interaction states as
72+
[standard buttons](../buttons-menus/buttons.md).
73+
74+
![Button group styles](images/button-group-styles.png)
75+
76+
Although different hierarchies (e.g., primary, secondary, tertiary, or danger) can technically be
77+
combined within the same group, this is not recommended.
78+
**All items should share the same visual style** to maintain cohesion and clarity.
79+
80+
![Button group do and donts](images/button-group-do-and-donts.png)
81+
82+
The **selection button** has a dedicated style and is only available in this variant.
83+
84+
![Segmented Buttons States](images/segmented-button-usage-states.png)
85+
86+
### Sizes
87+
88+
The button group follows the same sizing system as standard buttons.
89+
The default size is `32px`, matching the default button height.
90+
A large size at `40px` is also available for layouts that require increased prominence or touch-friendly targets.
91+
92+
### Responsive behavior
93+
94+
The button group component has by nature a horizontal layout and can't be
95+
wrapped or stacked. Therefore, it is recommended to keep the number of items
96+
low to avoid overflowing on smaller screens.
97+
98+
Alternatively,, actions can be collapsed under a menu or replaced with a [select](../forms-inputs/select.md),
99+
[radio](../forms-inputs/radio.md), or [checkboxes](../forms-inputs/checkbox.md) component,
100+
depending on the interaction type.
12.7 KB
Loading
8.85 KB
Loading
52.6 KB
Loading
78 KB
Loading
15.8 KB
Loading
25 KB
Loading
42.1 KB
Loading

mkdocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ nav:
5252
- Overview: 'components/index.md'
5353
- Buttons & menus:
5454
- Buttons: 'components/buttons-menus/buttons.md'
55+
- Button Group: 'components/buttons-menus/button-group.md'
56+
- Segmented Button: 'components/buttons-menus/segmented-button.md'
57+
- Split buttons: 'components/buttons-menus/split-button.md'
5558
- Content Action Bar: 'components/buttons-menus/content-actions.md'
5659
- Dropdowns: 'components/buttons-menus/dropdowns.md'
5760
- Help Button: 'components/buttons-menus/help-button.md'
5861
- Links: 'components/buttons-menus/links.md'
5962
- Menu: 'components/buttons-menus/menu.md'
60-
- Segmented Button: 'components/buttons-menus/segmented-button.md'
61-
- Split buttons: 'components/buttons-menus/split-button.md'
6263
- Dashboards:
6364
- Overview: 'components/dashboards/index.md'
6465
- Dashboard: 'components/dashboards/dashboard.md'

0 commit comments

Comments
 (0)