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
{{ message }}
This repository is currently being migrated. It's locked while the migration is in progress.
* Changes
- intro text change
- contractions
- remove codeblock for va-table
- add "component" to Select
- hyperlink Search Filter
- remove italics
* revert to pre-staging for 1 bullet with post-staging guidance applied
* revert to pre-staging, too many sub bullet
* sort by italic to bold
* remove italics
* Update sort.md
---------
Co-authored-by: Matthew Dingee <52176351+humancompanion-usds@users.noreply.github.com>
intro-text: "The Sort component allows users to reorder search results and lists of information to make information easier to analyze."
7
+
intro-text: "The Sort component allows users to reorder search results and lists of information, making information easier to analyze."
8
8
web-component: va-sort
9
9
web: true
10
10
mobile-app: false
@@ -63,7 +63,7 @@ anchors:
63
63
* Claims
64
64
* History
65
65
66
-
***When there is more than one page of results or more than 10 items.**
66
+
***When there's more than one page of results or more than 10 items.**
67
67
68
68
69
69
### When to consider something else
@@ -72,14 +72,14 @@ anchors:
72
72
***When there's only one obvious order.** You need at least two sort options to use this component.
73
73
***When you want to narrow results down.** Use a [Filter]({{ site.baseurl }}/components/search-filter) instead.
74
74
* For example, don't use Sort to filter by date ranges. <imgsrc="{{ site.baseurl }}/images/components/sort/sort_nonexample.png"alt="Nonexample where Sort is being used to filter by a date range"style="width:50%;"/>
75
-
***When sorting within a table**, use the sort columns baked into the `va-table` component.
75
+
***When sorting within a table**, use the sort columns baked into the [Table]({{ site.baseurl }}/components/table) component.
76
76
77
77
78
78
### Behavior
79
79
80
80
#### Web
81
81
82
-
***Clicking or tapping the component opens the list of sort options.** Alternatively, a screen-reader user may arrow up and down the list without opening the menu. The Sort component uses the [Select]({{ site.baseurl }}/components/form/select) as the foundation and shares similar behavior.
82
+
***Clicking or tapping the component opens the list of sort options.** Alternatively, a screen-reader user may arrow up and down the list without opening the menu. The Sort component uses the [Select]({{ site.baseurl }}/components/form/select) component as the foundation and shares similar behavior.
83
83
84
84
***Results automatically update when you select a sort option.** This is known as implicit submission.
85
85
***Why implicit submission?**
@@ -92,18 +92,18 @@ anchors:
92
92
***Sort selections persist across interactions.** The sort criteria should remain when users navigate through paginated results or refresh the page.
93
93
94
94
***Sizing and alignment differ on mobile and desktop.**
95
-
* On desktop resolutions, the *Sort by* label is in line with the dropdown and the width is fixed. Choose the Medium (md), Large (lg), or Extra Large (xl) size, whichever prevents truncating the longest sort option.
96
-
* On mobile resolutions, the *Sort by* label is stacked on top of the dropdown and the component is full-width and responsive.
95
+
* On desktop resolutions, the **Sort by** label is in line with the dropdown and the width is fixed. Choose the Medium (md), Large (lg), or Extra Large (xl) size, whichever prevents truncating the longest sort option.
96
+
* On mobile resolutions, the **Sort by** label is stacked on top of the dropdown and the component is full-width and responsive.
97
97
98
98
99
99
#### Placement
100
100
101
101
***Place Sort above and aligned with the content that it affects.** It serves as a visual indicator of the current order.
102
-
***Place Sort after the Search Filter's [results description]({{ site.baseurl }}/templates/search-results#results-description) when used with filtering.** This prevents the focus from skipping the Sort component given that the focus for filtering moves to results description or results heading and the focus for sorting is maintained on the component.
102
+
***If used with the [Search Filter]({{ site.baseurl }}/components/search-filter), place Sort after the Search Filter's [results description]({{ site.baseurl }}/templates/search-results#results-description).** This prevents the focus from skipping the Sort component given that the focus for filtering moves to results description or results heading and the focus for sorting is maintained on the component.
103
103
104
104
### Mobile app
105
105
106
-
***Note that the VA mobile app does not currently use this component.** It uses its own combined Filter & Sort button that opens a modal to select and explicitly submit sort and filter options.
106
+
***Note that the VA mobile app doesn't currently use this component.** It uses its own combined Filter & Sort button that opens a modal to select and explicitly submit sort and filter options.
107
107
* <imgsrc="{{ site.baseurl }}/images/components/sort/va_mobile_filter_sort.png"alt="A Filter and Sort button that opens a modal that allows a user to explicitly submit sort and filter options."style="width:100%;"/>
108
108
109
109
***Keep sort option naming consistent across mobile and desktop experiences.**
@@ -113,26 +113,25 @@ anchors:
113
113
114
114
***Using an API to sort and paginate data is acceptable.** If sorting data on the frontend is more efficient, remember to format times and dates in a way that will ensure a correct chronological sort.
115
115
* Store date and time as an [ISO-formatted string](https://en.wikipedia.org/wiki/ISO_8601#:~:text=Date%20and%20time%0Ain,00%20UTC%E2%88%9212%3A00) (date and time in UTC or date and time with offset).
116
-
* Attempting to sort dates as strings like *2/20/2025*, *10/1/2024*, *9/5/2023* from newest to oldest, for example, could result in a non-chronological A-Z sort:
117
-
* ***1****0/1/2024*
118
-
* ***2****/20/2025*
119
-
* ***9****/5/2023*
116
+
* Attempting to sort dates as strings like 2/20/2025, 10/1/2024, 9/5/2023 from newest to oldest, for example, could result in a non-chronological A-Z sort:
117
+
* **1**0/1/2024
118
+
* **2**/20/2025
119
+
* **9**/5/2023
120
120
* A true chronological sort by year, month, then day would instead be:
121
-
* *2/20/****2025***
122
-
* *10/1/****2024***
123
-
* *9/5/****2023***
121
+
* 2/20/**2025**
122
+
* 10/1/**2024**
123
+
* 9/5/**2023**
124
124
125
125
126
126
127
127
## Content considerations
128
128
129
129
### Content expectations
130
-
***Provide a default sort option** that reflects what users expect in the given context. In search experiences, *Relevance* is often the default.
130
+
***Provide a default sort option** that reflects what users expect in the given context. In search experiences, "Relevance" is often the default.
131
131
132
132
***Name sort options clearly and consistently** using this convention:
133
133
*`Sort attribute (sort method)`
134
-
* `Sort attribute` describes what the results are sorted by.
135
-
* Examples: Medication name, entry date, distance
134
+
* `Sort attribute` describes what the results are sorted by. For example, medication name, entry date, or distance.
136
135
* `(Sort method)` describes how the results are ordered. Use familiar, plain language terms such as:
137
136
* **Alphabetical**
138
137
* A to Z
@@ -159,9 +158,9 @@ anchors:
159
158
160
159
***Only include sort options that are relevant to a user goal.**
161
160
162
-
***Allow users to sort in both directions.** This is not necessary when the reverse order is not meaningful or useful. For example, it may not make sense to sort VA locations from furthest to closest.
161
+
***Allow users to sort in both directions.** This isn't necessary when the reverse order isn't meaningful or useful. For example, it may not make sense to sort VA locations from furthest to closest.
163
162
164
-
***Sort does not need to be reflected in the [results description]({{ site.baseurl }}/templates/search-results#results-description) for web and mobile.** The component already acts as a visual indicator of the order. However, it is required for the mobile app since the sort state is hidden within the modal.
163
+
***Sort doesn't need to be reflected in the [results description]({{ site.baseurl }}/templates/search-results#results-description) for web and mobile.** The component already acts as a visual indicator of the order. However, it's required for the mobile app since the sort state is hidden within the modal.
165
164
166
165
167
166
@@ -171,7 +170,7 @@ These considerations describe how sorting changes are communicated and experienc
171
170
### User experience expectations
172
171
* Inform users when results have updated after a sort option is selected. This is especially important for screen reader users who may not see the visual change.
173
172
* Ensure sorted results update in a meaningful and predictable order so all users perceive the same sequence of information ([WCAG 1.3.2 Meaningful Sequence](https://www.w3.org/WAI/WCAG21/Understanding/meaningful-sequence.html)).
174
-
* Update results in place during sorting and do not trigger page navigation or a full context change.
173
+
* Update results in place during sorting and don't trigger page navigation or a full context change.
175
174
* Keep focus stable on the sort control during sorting so users can continue interacting without losing their place.
176
175
* Inform users that an update is in progress if sorting takes time by following the [Loading Indicator guidance]({{ site.baseurl }}/components/loading-indicator).
0 commit comments