Skip to content

Commit f106a57

Browse files
Website: Update Button Organization pattern (bug bash) (#2676)
Co-authored-by: Jory Tindall <jory.tindall@hashicorp.com>
1 parent 67717f7 commit f106a57

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

website/docs/patterns/button-organization/partials/guidelines/alignment.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,42 @@ Alignment refers to how buttons and actions are aligned relative to the containe
66

77
When considering internationalization (i18n), **start** and **end** are suitable substitutes for **left** and **right** alignment to account for languages that are read right-to-left ([RTL](https://developer.mozilla.org/en-US/docs/Glossary/RTL)).
88

9-
![Button alignment options](/assets/patterns/button-organization/alignment-methods.png)
9+
![](/assets/patterns/button-organization/alignment-methods.png)
1010
!!!
1111

1212
### Left alignment
1313

14-
Actions are aligned to the left of the container or page. A common example of this alignment method is in [Modals](/components/modal) and page-level forms.
14+
In most scenarios, align buttons to the **left side** of a container or page. The primary button should be leftmost, followed by secondary, then tertiary.
1515

16-
![Left alignment example](/assets/patterns/button-organization/using-left-alignment.png)
16+
- This reinforces natural reading patterns and a conversational "dialog-like" messaging strategy.
17+
- When combined with a consistent ordering method, the primary button is prioritized in the reading direction.
18+
- When considering different contexts, opting for a single method helps to create consistency between constrained and unconstrained components and patterns.
19+
20+
A common example of this alignment method is in [Modals](/components/modal) and page-level forms.
1721

1822
!!! Do
1923

20-
In most scenarios, align buttons to the **left side** of a container or page.
24+
Align buttons to the left side of the container.
2125

22-
- This reinforces natural reading patterns and a conversational "dialog-like" messaging strategy.
23-
- When combined with a consistent ordering method, the primary button is prioritized in the reading direction.
24-
- When considering different contexts, opting for a single method helps to create consistency between constrained and unconstrained components and patterns.
26+
![Modal with buttons in the footer aligned to the left. The reading order goes from left to right, top to bottom.](/assets/patterns/button-organization/alignment-reading-pattern-comparison.png)
2527

26-
![Button alignment reading pattern](/assets/patterns/button-organization/alignment-reading-pattern.png)
2728
!!!
2829

2930
### Right alignment
3031

31-
Actions are aligned to the right of the container or page. This alignment method is commonly used for page-level functions or actions that create and manage elements within a page.
32+
In the case of page-level functions or actions that manage elements within the page, align buttons to the right of the page. The primary button should be the farthest right, then secondary, then tertiary.
3233

33-
![Right alignment example](/assets/patterns/button-organization/using-right-alignment.png)
34+
![Peering connections heading with a "Create connection" button right aligned to the container. A table of peering connections below.](/assets/patterns/button-organization/using-right-alignment.png)
3435

3536
### Center alignment
3637

37-
Actions are aligned in the middle of the container or page. This alignment method is _not_ recommended in the majority of scenarios.
38+
This alignment method is _not_ recommended in the majority of scenarios.
3839

3940
- Can cause buttons to needlessly fill the horizontal space of the container
4041
- Can cause buttons to appear detached from the content they are paired with, especially if a user has increased zoom settings within their browser
4142

4243
!!! Dont
4344

44-
![Center alignment example](/assets/patterns/button-organization/using-center-alignment.png)
45+
![Align buttons in the center of a form container.](/assets/patterns/button-organization/using-center-alignment.png)
4546
!!!
4647

website/docs/patterns/button-organization/partials/guidelines/grouping.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
How actions are grouped can influence what the user perceives as the primary action. Actions grouped correctly can alleviate decision fatigue and help users better understand the outcome of their actions.
44

5-
- Group buttons together that perform similar, related, and inverse functions. This generally refers to functions like "yes/no" or "ok/cancel."
5+
- Group buttons together that perform similar, related, and inverse functions. This generally refers to functions like "yes/no" or "ok/cancel".
66
- Inverse grouping generally helps users to make decisions quicker as their options are limited.
77
- As a best practice, tertiary actions should only be used if they help the user make a decision (linking to a different area of the application or documentation).
88
- Presenting the user with more than one action in this context can be confusing and force the user to question whether they are making the correct decision. Read more about [Hick's Law](https://www.interaction-design.org/literature/article/hick-s-law-making-the-choice-easier-for-users).

website/docs/patterns/button-organization/partials/guidelines/order.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ User edits the settings of a cluster:
5858

5959
A possible exception to this ordering method is in multi-step and progressive flows in which buttons fulfill both a functional purpose (create or edit something) and a navigational purpose (proceed, go back).
6060

61-
- The **directionality** and positive outcome of the overall flow are reinforced by the button order and grouping
61+
- The **directionality** and positive outcome of the overall flow are reinforced by the button order and grouping.
6262
- In a multi-step flow, this type of pattern would persist on the page; the repetitiveness acts as a form of consistency scoped to the feature the pattern is used in.
6363

6464
![Multi-step progressive flow](/assets/patterns/button-organization/multi-step-progressive-flow.png)
@@ -69,7 +69,7 @@ As the viewport size shrinks, buttons should stack vertically in accordance with
6969

7070
- This naturally adheres to our ordering guidelines; button order remains the same, except the container is vertical rather than horizontal.
7171
- This reduces complexity in engineering.
72-
- This ensures our applications meet accessibility conformance in [making the DOM order match the visual order](https://www.w3.org/TR/WCAG20-TECHS/C27.html)
72+
- This ensures our applications meet accessibility conformance in [making the DOM order match the visual order](https://www.w3.org/TR/WCAG20-TECHS/C27.html).
7373

7474
!!! Do
7575

Loading
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)