Skip to main content

BETANow in public beta.Public betaBeta

日本語Español

SRCH-004 Published · Updated

Search with suggestions

A design that shows matching pages as suggestions under the input while the reader is still typing.

FigmaThis part is included in our free, editable Figma file: 235 website UI patterns across 32 parts, 2 designs each Open in Figma Community ↗ (opens in a new tab)

Wireframe (desktop) | Search with suggestions

Search with suggestions UI design (desktop wireframe)

Wireframe (mobile) | Search with suggestions

Search with suggestions UI design (mobile wireframe)

What changes on mobile

  1. Each suggestion given height: Pressed by finger, so neighboring suggestions are not hit by mistake.
  2. Kind labels shortened: Keeps titles from wrapping and the list from growing long.

Before you choose this pattern | Search with suggestions

Good fit

  • Readers often search by page title, and you want them to open pages straight from the suggestions
  • Many pages found by fixed words: service names, FAQs
  • Spellings vary, and you want to show the right word mid-typing

Poor fit

  • Few pages, so suggestions would only ever show one or two
  • No way to build a suggestion source (an input and the <a href="/patterns/en/search-results/">search results</a> are enough)

Why this wireframe works | Search with suggestions

Open the page without finishing the word

Matching pages appear as suggestions while typing, and the chosen one opens directly. This saves typing long words and reduces misspellings.

Matched text and kind make suggestions easy to tell apart

The part matching the typed text is bold, and each suggestion carries its kind, such as Page or FAQ. Even with similar titles, it is easy to judge which to open.

Suggestions can be chosen by keyboard

The input is a role=”combobox” and the list a role=”listbox”, so ↑↓ chooses a suggestion and Enter opens it. The chosen suggestion is conveyed with aria-activedescendant, and the number of suggestions is announced.

A full search is still available when nothing matches

When nothing matches, the list says so and Enter runs a full search, so the search does not stop at the lack of suggestions.

Common mistakes | Search with suggestions

Focus leaving the input when suggestions appear

If focus moves to the list when suggestions appear, typing cannot continue. Keep focus in the input and convey the chosen suggestion with aria-activedescendant only.

No way to close the suggestions

If the list keeps covering the buttons and links beneath the input, readers are stuck. Close it on Esc and on clicking outside the input.

Too many suggestions

Ten or twenty suggestions take time to choose from. Keep to a small number (five to eight as a guide) and leave the rest to the full search.

A request on every keystroke

Sending a request on every keystroke delays the suggestions. Wait briefly after typing stops before showing them, and tune the interval.

Stale responses overwriting newer input

When suggestions are fetched on every keystroke, responses can arrive out of order and show old suggestions. Show only the response that matches the latest input, and cancel or discard older requests. Keep the result count, aria-activedescendant and aria-expanded in sync with the latest state.

FAQ | Search with suggestions

After how many characters should suggestions appear?

In English, two or three characters usually narrow the list enough; one character often matches too much. If there are still too many, start from three.

Should a chosen suggestion open the results page or the page itself?

For a page-title suggestion, opening the page directly gets readers there faster. For a term suggestion (a popular search), opening the results page for that term fits better.

The browser’s own history overlaps the suggestions.

When the browser’s input history overlaps the suggestions, set the input’s autocomplete to off so only the site’s suggestions show.

Related pages

Share this pattern

Send this page to your team or your design partner.

Was this pattern useful?

Written by

Yuta Okano

ENVY DESIGN Inc.

CEO / Director / Designer

14 years in the web industry. Has worked on more than 500 web projects, from corporate and recruiting sites to e-commerce. Focuses on information architecture, direction and design, from planning websites to improving them. In recent years he has focused on AIO (AI optimization) and GEO, helping sites get cited by generative AI search such as ChatGPT, Perplexity and Google AI Overviews.

Review and revision history

  1. Published AvatarYuta Okano Pattern published