Skip to main content

BETANow in public beta.Public betaBeta

日本語Español

SRCH-002 Published

Icon toggle search

A design that puts only a magnifier button in the header and opens a search field in a row under the header when pressed.

Wireframe (desktop) | Icon toggle search

Icon toggle search UI design (desktop wireframe)

Wireframe (mobile) | Icon toggle search

Icon toggle search UI design (mobile wireframe)

What changes on mobile

  1. Magnifier as an icon only: The header is too narrow for a word, so the name is given by aria-label.
  2. Search field opens full width: A wide input keeps the typed words visible.

Before you choose this pattern | Icon toggle search

Good fit

  • A header with many menu items and no room for a permanent field
  • Search is used, but more readers navigate by the menu
  • You want the same way into search on mobile and desktop

Poor fit

  • Search is the main way readers find things (showing the field, as in the <a href="/patterns/en/search-header/">header search</a>, gets more use)

Why this wireframe works | Icon toggle search

Search stays available in a tidy header

A magnifier button stands in for the input field, leaving the header width for the menu. The field opens only when wanted, so the everyday header looks clean.

The word “Search” beside the icon

Some readers do not recognize a magnifier alone as search. On desktop the word “Search” sits beside the icon, saying what pressing it does.

Ready to type as soon as it opens

Pressing the button opens the search field and moves focus to the input automatically, saving the extra press on the field.

The open or closed state reaches screen readers

The button carries aria-expanded to convey whether the field is open. Closing with the close button or Esc returns focus to the original button.

Common mistakes | Icon toggle search

An icon-only button with no name

A button with only a magnifier image is announced as just “button”. Even without visible text, name it with aria-label=”Search” or similar.

Focus not moved to the input on opening

If the field opens but the input is not focused, readers have to press again. Move focus to the input on opening so they can type at once.

No obvious way to close

With no close button after opening, readers are unsure how to get back. Add a close button and let the Esc key close it too.

An open field that hides the content

A field opened over the content hides what was being read. Insert it as a row under the header, or restore the original position on closing.

FAQ | Icon toggle search

Open under the header, or full screen?

For typing alone, opening under the header is enough. To show popular terms or suggestions alongside, opening full screen suits better.

Can the same layout be used on mobile?

Keeping the same layout means the way to search does not change between desktop and mobile. On mobile use the icon alone and keep the pressable area about 44px tall.

Can the search button sit next to the menu button?

Yes. Use different icons and name each so readers can tell the menu button from the search button.

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