Explore behaviors before defining the interface.
Quick guide for designers
Always consider the context of the application, even when the guidance follows a standard pattern. Interaction design documents intent. Behavior must be verified in the implementation.
When to use
Use to enter terms and find content.
What to design
Show the label, field, results, filters, and clearing controls. Include initial, loading, no matches, and failure states with retry.
How it behaves
Define whether search runs on submission or while typing. Clearing empties the field without submitting and allows continued editing.
What to document in Figma
Record search scope, submission or dynamic updates, filters, pagination, and clearing. Define how to preserve the query and communicate results without moving focus unexpectedly.
How to review
Check whether the purpose and states are clear on small and large screens and with zoom. Verify documented behavior in the implementation, including keyboard and screen reader use where applicable.
Full guidance
Interaction Design
Questions to ask when designing Input "search" components.
Assess each guideline according to the component's context of use.
Designing for "no interaction"
- Does the label remain visible and explain the field's purpose?
- Are instructions, required status, and limits available before entry?
- Are empty, filled, invalid, disabled, and read-only states distinguishable without relying solely on color?
Designing for mouse use
- Does clicking the field or its associated label focus it for typing?
- Do focus and associated controls provide perceptible visual feedback?
Designing for gesture use
- Does the touch area allow selecting the field and its controls without accidental activation?
- Do the virtual keyboard and zoom allow the field to remain visible and editable?
Designing for keyboard use
TabandShift + Tabmove through controls in interface order?- Can you edit and select text using native commands without trapping focus?
Designing for screen reader use
- Are name, type, required status, instructions, and errors presented understandably?
- Is the label associated with the field and still available after filling it in?
Editorial extension — interaction patterns and decisions
Magoo editorial adaptation: extends the previous guidance with design, documentation, and review decisions. References support the adaptation; these scenarios do not represent executed tests or certification.
From the field to the search experience
Define the search scope: the whole site, a section, or a set of records. Keep the submitted term visible and distinguish text being edited from the query whose results are displayed.
Choose between explicit submission and updates while typing. With explicit submission, Enter and the Search button run the same search. For dynamic updates, document the delay before querying and prevent an older response from replacing results for a newer query.
Search suggestions and results are different sets. If autocomplete is present, document when suggestions appear and whether committing one only fills the field or also runs the search. Adopt a combobox pattern appropriate to the interaction.
Results, filters, and recovery
Design initial, loading, results, no matches, and query failure states. A failure must not look like a search with no results. Offer retry while preserving the term and filters.
Show result count, submitted term, and applied filters. With no results, allow editing the term or removing filters. Define whether filters update immediately or require Apply, and their effect on pagination.
Distinguish Clear search, Remove filter, and Clear all filters. Document whether clearing the field also updates results. When returning from a result, preserve the query, filters, and page when that continuity is part of the flow.
Design and implementation review
In the design, check that each result provides enough title and context to choose a destination, including on small screens. In the implementation, verify keyboard search, filters, clearing, and failure recovery while keeping focus predictable. For same-page updates, communicate a summary after the response without announcing every keystroke or rereading the full list.
Interaction Methods
Scope: the basic methods below describe the search field. Results, filters, and failure recovery are covered in the editorial extension of the Interaction design tab.
The field uses type="search" and has a label explaining what will be searched.
Mouse interaction
- Clicking the field or its associated label puts focus in the field.
- Selecting, editing, copying, and pasting follow the field's native behavior.
Keyboard interaction
Tabmoves focus to the field;Shift + Tabreturns to the previous control.- Typing inserts text;
arrow navigation,Home,Endand selection and editing commands follow the platform. Enterfollows the form's defined submission action; the field does not create a new line.
Gesture interaction
Tappingthe field or label allows editing with the virtual keyboard.- Text selection and editing follow the platform's available gestures.
Keyboard (or gesture) interaction + screen reader
- When navigating to the field, the reader presents its label and type, along with associated states and instructions.
- Errors are associated with the field and explain how to correct the information; the entered value is preserved.
Submit and clear search
Entersubmits the search when that is the defined mode; the "Search" button, when present, also submits it.- The "Clear search" control, when present, empties the field without submitting the form and allows further editing.
- Communicate the result count or lack of results without moving focus unexpectedly.
Gherkin
BDD (Behavior-Driven Development) methodology focusing on three pillars: User Stories, Acceptance Criteria, and Gherkin Syntax (Given, When, Then).
Scenario: Given that I am on a page containing Input "search"
Keyboard navigation
- WHEN I use the
Tabkey to move focus to the field - The focus I SEE is strongly indicated visually
- THEN, when I type, select, or edit content using native commands
- I SEE the field value updated
- AND, when I use
TaborShift + Tab, I SEE focus follow page order without getting trapped in the field
Screen reader on desktop
-
WHEN I use a screen reader on a computer (NVDA, JAWS, VoiceOver) and use the
Tabkey to move focus to the field, the following happens:- I HEAR the field's label and purpose.
- I HEAR that the component is a search field.
- I HEAR the required status, instructions, and associated errors, when present.
- THEN, when I type or edit content using native commands
- I HEAR or perceive that I can edit the field and that its value was updated.
Screen reader on mobile devices
-
WHEN I use a screen reader on a phone (TalkBack, VoiceOver) and swipe to focus the field, the following happens:
- I HEAR the field's label and purpose.
- I HEAR that the component is a search field.
- I HEAR the required status, instructions, and associated errors, when present.
- THEN, when I double-tap or use the appropriate gesture to activate the field and edit its content
- I HEAR or perceive that I can edit the field and that its value was updated.
Input validation
- WHEN an entry is rejected by a stated validation rule
- I SEE a message associated with the field explaining how to correct the information
- AND, when I navigate to the field with a screen reader, I HEAR the error indication and associated guidance
- THEN, when I edit again, I SEE the value preserved for correction
Search activation
- WHEN I enter a term and activate search according to the defined mode
- I SEE results or a no-results message
- AND, when I use a screen reader, I HEAR or perceive search feedback without an unexpected focus change
Additional scenarios — editorial extension
Dynamic search: out-of-order responses
- GIVEN two successive queries
- WHEN the first response arrives after the second
- THEN results still match the latest query and focus remains predictable.
Filters with no matches
- GIVEN a search with no matches and applied filters
- WHEN I remove a filter and apply the change according to the defined flow
- THEN results and their count update while the term and remaining filters are preserved.
Query failure and retry
- GIVEN a query failure
- WHEN I activate Retry
- THEN the search uses the preserved term and filters and presents its outcome without confusing failure with no matches.
Points to consider
- Use a persistent label associated with the input. A placeholder is a supplementary hint and does not replace the label.
- Associate instructions and errors with the field, for example using aria-describedby, and set aria-invalid when there is an error.
- Indicate required status and use required when needed. Do not communicate errors solely through color.
- Keep focus visible and ensure adequate contrast and interaction area.
- Define whether search happens on submission or while typing. For dynamic search, preserve focus and communicate results without announcing every key; allow clearing and handle empty results.
References
Additional references for components of type Input "search".
Important:
Most references are on the course platform alongside the lessons cited in this material.
Disclaimer:
The links listed here are a curated collection of references where you can find implemented components, rather than recommendations. There is no unified implementation format and no guarantee that these links follow every design pattern. Direct questions to the teams responsible for the linked materials. Before copying a model, remember that all materials are constantly updated and that patterns, particularly proprietary ones, may change.
Field documentation
Design System
- Carbon — Search open_in_new (external link, opens in a new tab) — Component specifically for entering search terms.
- USWDS — Search open_in_new (external link, opens in a new tab) — Field and button to activate a search.