DEV Community

FrozonFreak
FrozonFreak

Posted on Originally published at thewebhig.hashnode.dev

The URL is the interface — Web HIG tip #2

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.

Top comments (0)