Skip to main content

Search Bar

UI Design

What is a Search Bar

A search bar is a text field where users type a query to find content in a site or app. It usually shows a magnifying glass icon, placeholder text and a button or key to submit, and often suggests results as users type.

Anatomy of a Search Bar

  • Input field: Where users type the query
  • Search icon: The magnifying glass, one of the few universal icons
  • Placeholder: A hint such as "Search jobs"
  • Clear button: Removes the query in one tap
  • Suggestions: Optional results or queries while typing

Where to place a Search Bar

Put it at the top of the page, usually on the right. On search-led products, it can be the center of the page. Show a visible box, not just an icon, so users find it quickly.

Search Bar best practices

Make the field wide enough for a typical query. Keep it simple and avoid making users choose a scope before they search. Show helpful suggestions and handle no-results with a useful empty state.

Frequently asked questions

Where should a search bar go?

At the top of the page, usually in the right corner, where users look for it. NN/g notes the left side works almost as well. On search-heavy sites, it can sit in the center of the page.

Should search be a visible box or just an icon?

A visible box is better on most sites. Users scan for "the little box where I can type", and a box is found faster than an icon that must be clicked first.

How wide should a search bar be?

Wide enough to show a typical query without scrolling. If the box is too small, the text scrolls out of view and users cannot check what they typed.