PatternCraft conventionFoundational
Sorting
Reordering a set, where the default order is the decision that matters most.
Definition
Sorting arranges results by an attribute. Because most users never change it, the default sort is one of the highest-impact defaults in any product.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
Getting it right
- Choose the default that answers the most common question, not the one that is cheapest to compute.
- Show the current sort explicitly, including direction.
- Make the direction indicator unambiguous. Arrow conventions vary, so pair the icon with text where space allows.
- Handle ties deterministically with a secondary key, or the order will shuffle between page loads.
- In tables, make column headers sortable and announce the sort state with aria-sort.
- Preserve sort state across pagination and navigation.
In practice
Unstable sort ordering
Data tablesSorting by a column with many equal values without a tiebreaker makes rows jump between page loads. Users read this as a bug and lose confidence in the data.
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Applies when you are designing
Principles behind this
The reasoning this solution is an application of.
- Default EffectCognitive bias
- Natural MappingPrinciple
- Choice OverloadPsychology
Often used with
These usually appear in the same screen or the same decision.
- Data TableComponent
- PaginationComponent
- FilteringPattern
- SearchPattern