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 draw
Show the label, field, results, and no-results state. Include Search and Clear search when used.
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 submission, clearing, and how results are communicated without unexpectedly moving focus or announcing each keystroke.
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?
Interaction methods
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 keys,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
- Tapping the 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
Desktop screen reader
-
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.
Mobile screen reader
-
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
Considerations
- 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
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.