Skip to main content

BETANow in public beta.Public betaBeta

日本語Español

SRCH-001 Published · Updated

Header search

A design that places a search field, ready for input at any time, at the right of the header.

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) | Header search

Header search UI design (desktop wireframe)

Wireframe (mobile) | Header search

Header search UI design (mobile wireframe)

What changes on mobile

  1. Search field moved to a row under the header: Inside the header it would collide with the logo and menu button and become too narrow.
  2. Larger text in the field: Small text makes the screen zoom when typing, which is hard to read.

Before you choose this pattern | Header search

Good fit

  • Many pages, and readers often search by words
  • Many services, products or FAQs that are hard to reach through the menu alone
  • The header has room for an input field

Poor fit

  • Few pages, and the menu alone reaches every page (leaving search out keeps the header tidier)
  • A header with many menu items and no room for a field (the <a href="/patterns/en/search-icon-toggle/">icon toggle search</a> works better)

Why this wireframe works | Header search

It is obvious that the site can be searched

Some readers never notice a lone magnifier icon means search. The input field itself is shown in the header, so before pressing anything readers see that words typed here will find pages.

Search from the same place on every page

The search field sits in the header, so whichever page is open, search is in the same position. Because the way to search never moves, readers are less likely to get lost.

The scope of the search is stated in the field

The input shows “Search this site”, making clear it searches this site rather than the whole internet. The input is labeled so screen readers convey it too.

On mobile, the field moves under the header

An input inside the mobile header collides with the logo and menu button and becomes narrow. On mobile the field moves to a row under the header, where it can be full width.

Common mistakes | Header search

A placeholder with no label

The faint text inside the field disappears once typing starts and may not reach screen readers. Even when no visible label is shown, name the input with aria-label or similar.

An input too small for the words

Too narrow an input hides part of what has been typed. Make it wide enough for common search terms.

No search button, so only Enter submits

Readers unfamiliar with keyboards are unsure how to submit after typing. Add a button such as a magnifier, and name it “Search” too.

A prominent field on top of a weak search

A prominent field with poor results loses readers’ trust. Get the search quality and the no-results message right before making the entry point prominent.

FAQ | Header search

How many pages before site search is needed?

There is no fixed threshold. When more and more pages take several steps to reach through the menu, that is the sign to add search. While pages are few, tidying the menu comes first.

Which input type should the search field use?

Use a search input (type=search) and wrap the whole thing in a form with role=search, so it is recognized as a search field. The HTML search element is another option.

Is the default WordPress search good enough?

While pages are few, usually yes. It ranks only by matches in title and body, so once pages grow and irrelevant results stand out, that is the time to review the search engine.

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