StealThis .dev

Search Autocomplete

A rich search autocomplete input with categorized results, keyboard navigation, recent searches, and command shortcuts. Similar to Notion or Linear's search.

Open in Lab
css vanilla-js
Targets: JS HTML

Code

Search Autocomplete

A command-palette-style search input with grouped result categories, fuzzy text filtering, and full keyboard navigation. Recent searches are persisted to localStorage and appear when the input is focused but empty.

Features

  • Categorized search results with type icons (Page, User, Document, Chart, Settings)
  • Recent searches section with clock icon, loaded from and saved to localStorage
  • Fuzzy filtering of all results as the user types
  • Full keyboard navigation: arrow keys to move, Enter to select, Escape to close
  • Keyboard shortcut hint badge showing the Cmd+K / Ctrl+K trigger