You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: website/docs/patterns/form-patterns/partials/guidelines/guidelines.md
+17-36
Original file line number
Diff line number
Diff line change
@@ -4,63 +4,44 @@ Spacing between sections, fields, text, and other form elements should follow a
4
4
5
5
### Form
6
6
7
-
A **form** acts as a layout mechanism by wrapping the content, fields and actions to apply consistent spacing while simultaneously handling the logic for submitting information and data collected by the fields.
7
+
A **form** acts as a layout mechanism by wrapping the content, fields, and actions to apply consistent spacing while simultaneously handling the logic for submitting information and data collected by the fields.
8
8
9
-
As a layout mechanism, a form consisting of more than one section should use a 32px gap in between sections.
9
+
A form can contain more than one section and should use a 32px gap in between each section.

12
12
13
13
### Sections
14
14
15
-
A **section** occupies the largest hierarchy within the form. Sections organize text, fields (inputs, checkboxes, toggles, etc.), and actions into logical sets. There should be a 32px vertical gap between each section within the form container.
15
+
A **section** occupies the largest hierarchy within a form to organize text, fields, and actions into logical sets.
16
16
17
-

17
+

18
18
19
19
### Fields
20
20
21
-
A **field** describes a form control and label pairing. When displaying multiple fields within a section, there should be a 24px gap between each field.
21
+
A **field** describes a form control and label pairing. When displaying multiple fields within a section, use a 24px gap between each field.
22
22
23
-

24
-
25
-
<!-- TODO
26
-
Fields can be further divided into two types: **text fields** and **data fields**.
27
-
28
-
#### Text fields
29
-
| Form control | Usage | Examples |
30
-
|--------------|-------|----------|
31
-
| [Text input](/components/form/text-input) | lorem ipsum | Name, email, password, string and numerical data |
32
-
| [Textarea](/components/form/textrea) | Lorem ipsum | Messages, longer-form content |
33
-
-->
34
-
35
-
<!-- TODO
36
-
#### Data fields
37
-
| Form control | Usage | Examples |
38
-
|--------------|-------|----------|
39
-
| [Checkbox](/components/form/checkbox) | Lorem ipsum | Lorem ipsum |
40
-
| [Radio](/components/form/radio) | Lorem ipsum | Lorem ipsum |
41
-
| [Radio Card](/components/form/radio-card) | Lorem ipsum | Lorem ipsum |
42
-
| [Select](/components/form/select) | Lorem ipsum | Lorem ipsum |
43
-
| [Toggle](/components/form/toggle) | Lorem ipsum | Lorem ipsum |
44
-
-->
23
+

45
24
46
25
### Sets
47
26
48
-
Fields may be organized in a **set** either horizontally or vertically if they are collecting related information or information that is part of the same object. Within a set there should bea 16px gap either horizontally (creating multiple columns), or vertically between each field.
27
+
Fields can be organized in a **set** either horizontally or vertically if they are collecting related information or information that is part of the same object. Within a set use a 16px horiztonal or vertical gap between each field.
28
+
29
+
Within a set use a 16px gap either horizontally (creating multiple columns), or vertically between each field.
49
30
50
-

31
+

51
32
52
33
!!! Dont
53
34
54
-
Don't horizontally organize field types in a set that are related but not of the same type, e.g., a text input and a toggle.
35
+
Don't organize filed types that are unrelated in a horizontal set, e.g., a text input and a toggle.
55
36
56
-

37
+

57
38
!!!
58
39
59
40
!!! Do
60
41
61
42
Do stack fields of different types vertically.
62
43
63
-

44
+

64
45
!!!
65
46
66
47
Common sets of fields can include:
@@ -71,15 +52,15 @@ Common sets of fields can include:
71
52
72
53
#### Alignment
73
54
74
-
Fields organized in a horizontal set should be aligned to the baseline of each element to account for fields with helper text.
55
+
Fields organized in a horizontal set should be aligned to the baseline of the tallest element.
75
56
76
-

57
+

77
58
78
59
### Button sets
79
60
80
61
Organize buttons based on the [Button Set](/components/button-set) guidelines, e.g., using a 16px horizontal gap between buttons. More specifications and examples can be found in the documentation for [button organization](/patterns/button-organization).
0 commit comments