Loading pattern...

What is Search Bar?

Search Bars let users find content by typing keywords. Includes input field, search icon, clear button, and often autocomplete suggestions. Critical for content-heavy sites—users prefer search over navigation when they know what they want. Good search is fast, forgiving, and helpful.

When Should You Use This?

Add search when you have >20 pages/items, complex navigation, or diverse content (docs, e-commerce, SaaS). Place prominently (top nav or hero). Show autocomplete suggestions. Support filters for large result sets. Show "no results" state with suggestions. Index all important content. Use fuzzy matching to handle typos.

Common Mistakes to Avoid

  • Hidden search—users expect it top-right or center-top; don't bury in hamburger menu
  • No autocomplete—suggestions speed up search and guide users to findable content
  • Poor no-results page—suggest similar items, check spelling, show popular content
  • Slow results—search should feel instant (<300ms); index and cache aggressively
  • No keyboard shortcuts—add Cmd+K or "/" to focus search; power users love it

Real-World Examples

  • Algolia—instant search with autocomplete, typo tolerance, filters
  • Linear—Cmd+K command palette with search, recent items, actions
  • Notion—search pages, blocks, and content with previews and autocomplete
  • Stripe Docs—search API docs with autocomplete, highlights, and result snippets

Category

Form Patterns

Tags

search-barsearch-inputsearch-boxsite-searchui-pattern

Permalink