Design7 min

Search bar design: best practices with real examples

Search bar design best practices: placement, size, suggestions, typo tolerance, no-results pages and accessibility, with examples you can apply to your product.

Saurabh YadavFounder, Design Studio by Saurabh
DesignSearch bar designSearch bar UXSearch UI designAutocomplete UX
Share

Watch someone use a shopping app for five minutes and you'll notice something: the moment they know what they want, they stop browsing and go straight for search. They type "kurta", or "blue kurta cotton", or "kurta for wedding", and they expect the app to understand all three.

When search works, nobody notices it. When it fails, people assume the product doesn't have what they want and leave. That's why search bar design deserves more attention than a magnifying glass icon in the corner.

The short answer: Good search bar design means a visible, wide input field placed where people expect it (usually at the top), a clear label, helpful suggestions as people type, tolerance for typos and synonyms, and a results page that never leaves the user at a dead end. Treat search as a full flow, from the empty field to the no-results page, not just a box.

Make search easy to find

The first job of a search bar is to be found. On content-heavy sites and apps, where search is a main way people find things, show an open text field, not just an icon. Nielsen Norman Group has long recommended visible search boxes over hidden ones for this reason: an icon has to be noticed, understood and tapped before anything happens.

Placement guidelines that match what people expect:

  • Desktop websites: top of the page, usually in or near the header, often towards the right or centre.
  • Mobile apps: a search field near the top of the main screen, or a dedicated Search tab in the bottom bar if search is central to the app.
  • Inside a section: a search field above the list it searches, such as a contacts list or a table.

Keep it consistent. If search sits in the header on one page, it should be there on every page.

Size, shape and label

A tiny search field quietly tells people to type short queries, and it hides what they've typed. Make the input wide enough to show a typical query without scrolling. On mobile, give it nearly the full width of the screen.

Other basics:

  • A real label. Placeholder text like "Search" disappears the moment someone types, and many placeholders have poor contrast. Use a visible label or an accessible name with aria-label, and treat placeholder text as a hint only.
  • Useful placeholder hints. "Search products, brands or orders" tells people what they can search. "Search..." tells them nothing.
  • A clear submit action. A search button or icon for mouse users, and the Enter key for everyone else. On mobile, enterkeyhint="search" shows a search key on many keyboards.
  • A clear (X) button once there's text, so people can start over without deleting letter by letter.

Tip

Use type="search" on the input and wrap the search area in a <search> element or a container with role="search". Screen reader users can then jump straight to it as a landmark.

Suggestions and autocomplete

What happens as people type is where good search really shows.

Stage What to show Why it helps
Field focused, empty Recent searches, popular or trending searches Saves typing and shows what's possible
First few letters Query suggestions that complete the phrase Reduces typing and spelling errors
More specific text Direct matches (products, people, pages) with a small image or icon Lets people skip the results page
After submit Results with filters and sort Helps narrow a broad query
Nothing found Suggestions, corrected spelling, popular categories Avoids a dead end

A few rules for suggestions:

  • Highlight the part people didn't type, so they can scan the completions quickly.
  • Limit the list to a handful of items. Ten suggestions on a phone push the keyboard and the list into a fight for space.
  • Let people manage recent searches. A way to clear them matters, especially on shared family phones, which are common in India.
  • Make suggestions keyboard friendly. Arrow keys move through them, Enter selects, Esc closes the list. The combobox ARIA pattern describes how to announce this properly to screen readers.

Watch out

On slow networks, firing a request on every keystroke makes suggestions lag behind what the user is typing, and results jump around. Wait for a short pause in typing before fetching, and show cached recent searches instantly while the network catches up.

Forgive the way people actually type

People misspell, abbreviate, use local words and switch languages mid-query. Search should cope with all of it.

  • Typo tolerance. "Samsng" should still find Samsung. Show results for the corrected term with a small "Showing results for Samsung" note and an option to search the exact spelling instead.
  • Synonyms. "Mobile", "phone" and "smartphone" should land in the same place. So should "sofa" and "couch".
  • Plurals and word forms. "Shoe" and "shoes" should behave the same.
  • Hinglish and transliteration. Indian users often type Hindi words in Latin script, like "doodh" for milk or "chappal" for slippers, and spellings vary. If your audience is in India, map common local terms to your catalogue. I write more about this in designing for Indian users.
  • Voice search. A microphone icon helps people who find typing slow, but make sure the transcribed text appears in the field so they can fix mistakes.

Design the results page, not just the box

The search bar sets expectations; the results page has to meet them.

  • Keep the query visible in the field on the results page, so people can edit it instead of retyping.
  • Show the number of results and announce it to screen readers with a polite live region when results update.
  • Offer filters and sorting that match the content: price and rating for products, date for articles, status for orders.
  • Scope when it helps. In a large product, let people search "in this project" or "everywhere", and make the current scope obvious.
  • Highlight matching words in results so people can see why each result appeared.

The no-results page

This page decides whether people try again or give up. Never show only "No results found". Instead:

  • Repeat what they searched for, so they can spot a typo
  • Suggest a corrected spelling or related searches
  • Show popular categories or items
  • Offer another way forward, such as contacting support or browsing

My post on empty states and error messages has more patterns for screens like this.

Note

Your search logs are free user research. The queries that return no results tell you exactly what people expect to find and can't. Review them regularly and you'll find missing synonyms, missing products and confusing names.

A search bar design checklist

  • Search is visible as a field (not just an icon) where it's a main way to find things
  • The field is wide enough for a typical query, and nearly full width on mobile
  • It has a proper label or accessible name, not just placeholder text
  • Recent and popular searches appear when the field is focused
  • Suggestions are limited, highlighted and usable with arrow keys and Esc
  • Typos, synonyms, plurals and local terms are handled
  • Requests wait for a typing pause and cope with slow networks
  • The no-results page offers a way forward
  • No-result queries are reviewed regularly

Work with us

Want a team to design it with you? Our UI/UX design agency for startups and SaaS takes products from research to developer handoff.

FAQ

Where should the search bar be placed?

Put it where people expect it: at the top of the page on websites, usually in the header, and near the top of the main screen or in a Search tab on mobile apps. Keep it in the same place across the product. If search is a main way people find things, show a full field rather than only an icon.

Should a search bar have a search button?

A visible button helps mouse users and makes the action clear, but the Enter key and the mobile keyboard's search key should also work. On mobile, many apps rely on the keyboard's search key and suggestions instead of a separate button. What matters most is that submitting is obvious and works every way people try.

How many autocomplete suggestions should I show?

A handful is usually enough, roughly five to eight on desktop and fewer on mobile, where the keyboard takes up much of the screen. Too many suggestions slow people down instead of helping. Test on a small phone with the keyboard open to see what actually fits.

Key takeaways

  • Search bar design covers the whole flow: finding the field, typing, suggestions, results and no results.
  • Show a visible, wide search field with a real label where search matters.
  • Use recent searches, limited suggestions and keyboard support to reduce typing.
  • Handle typos, synonyms and Hinglish so people find things the way they actually type.
  • Never end on "No results found". Offer corrections, suggestions and another way forward.

What to do next

Search your own product for five things a new user might look for, including one misspelling and one local word. Note every dead end. Those notes are your search improvement backlog. If search is central to your product and you want it to feel effortless, tell me about your project.

Saurabh Yadav's Memoji

Written by

Saurabh Yadav

Founder of Design Studio by Saurabh, a UI/UX design studio in India. We design apps and websites that feel effortless, from research to shipped pixels. Most recently: Pukaar.ai, as seen on Shark Tank India, and the Demerara Bank app.

Keep reading

All articles →