If a filter, tab, search, or sort only lives in component state, you did not build a page. You built a view that dies on refresh.
Web HIG tip #2 (Quick #21–22): The URL is the single source of truth for tabs, filters, search, pagination, and sort. A deep link must restore the same view someone would get by using the UI.
When that state lives only in memory:
- Refresh wipes the view
- Share and "open in a new tab" open a different screen
- Back does not undo the last filter
- Support cannot reproduce the bug
Do this instead:
- Write view state into the query string (or a path segment) as the user changes it
- Read that URL on load and render from it. Do not keep a second source of truth in memory
- Make Back restore the previous view, not dump the user on a generic list
The Web HIG is a behavioral contract for how the web should behave, not a component library. Design systems define look. The Web HIG defines behave.
- Docs: https://frozonfreak.github.io/webhig/
- Quick Reference: https://github.com/frozonfreak/webhig/blob/main/HIG-QUICK.md
- Tip discussion: https://github.com/frozonfreak/webhig/discussions/8
- Repo: https://github.com/frozonfreak/webhig
Top comments (0)