# Search Bar Animation: Expanding, Suggesting and Showing Results

> Search should usually be visible as an open box, not hidden behind an icon. Animate focus so people know they can type, show suggestions quickly without jumping the layout, indicate loading for slower results, and follow the combobox pattern so keyboard and screen reader users can use suggestions. Expanding search icons are a compromise for tight spaces.

Updated November 2026. Source: https://www.exodeui.com/learn/search-bar-animation/

## Key takeaways

- Show search as an open box where it matters
- Animate focus, clear, suggestions, loading and no results
- Overlay suggestions, debounce, keep transitions short
- Follow the combobox pattern for accessibility

## Visible beats hidden

Nielsen Norman Group recommends showing search as an open text box on sites where search matters, because people look for the box, not a magnifying glass icon. Expanding search from an icon saves space but hides the feature. Use it in tight headers, and make the expansion fast.

## States to animate

Each change should be quick and clear:

- Focus: border or shadow change, placeholder fades
- Typing: clear button appears
- Suggestions: list appears below without pushing content
- Loading: small indicator inside the field for slow searches
- No results: helpful message, not an empty list

## Suggestions without jank

Overlay the suggestion list instead of pushing the page down, debounce requests so suggestions do not flicker on every keystroke, and keep transitions under about 200 ms. Highlight the matching part of each suggestion.

## Accessibility

Search with suggestions is a combobox. The WAI-ARIA combobox pattern describes the roles, states and keyboard behaviour: arrow keys move through suggestions, Enter selects, Escape closes. Announce the number of results for screen reader users.

## Frequently asked questions

### Should a search bar be an icon or a box?

A visible box where search is important. An expanding icon is a compromise for tight spaces.

### How fast should search suggestions appear?

Quickly enough to feel responsive while typing, with a short debounce to avoid flicker.

### How do I make search suggestions accessible?

Follow the WAI-ARIA combobox pattern with proper roles, states and keyboard support.

### Should the search bar expand on focus?

It can widen slightly to give room for typing, but keep the change quick.

## Related

- [Command palette vs navigation](https://www.exodeui.com/learn/command-palette-vs-navigation/)
- [Accessible focus states](https://www.exodeui.com/learn/accessible-focus-states/)
- [Dropdown menu animation](https://www.exodeui.com/learn/dropdown-menu-animation/)
- [Wiggle text input](https://www.exodeui.com/components/wiggle-text-input/)
