StealThis .dev

Empty States — No-search-results state

A live product-search panel that handles the moment a query returns nothing, turning a dead end into a recovery path. As you type, results filter in real time against a small in-memory catalog; when nothing matches, a calm empty state takes over with an animated magnifier illustration, a precise no-results headline echoing the query, spelling and keyword tips, a Clear-search action, and clickable suggested queries that refill the input. A segmented switcher demos three flavors: full suggestions, minimal, and active-filter chips you can clear.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

No-search-results state

A self-contained search results panel for a fictional gadget store. A live search field filters a small in-memory catalog as you type, rendering matching products as rows with color-coded thumbnails, category, price, and an in-stock or low-stock badge. A polite aria-live counter reports how many results are showing, and an inline clear button appears as soon as the field has text.

When a query matches nothing, the panel swaps the list for a no-results empty state: a CSS-animated magnifier illustration with a red “no match” cross, a headline that echoes the exact query — No results for ”…” — and a short list of recovery tips (check spelling, broaden keywords, remove filters). Below that, a row of suggested-query chips refills the input and re-runs the search on click, plus Clear search and Browse all products actions to get unstuck. Every action confirms with a small toast.

A segmented switcher renders three live variants: With suggestions (the full recovery state), Minimal (illustration, headline, and a single clear action — no suggested chips), and Active filters (filter chips for Category, Price, and In-stock that narrow results and can be removed individually or all at once, with a matching “remove filters” tip). The switcher is keyboard-navigable with arrow keys, Esc clears the field, and the layout collapses to a single column with stacked actions down to 360px.

Illustrative UI only — fictional products and data.