Sub topic 6
Presenting Search Results
Assume you already understand basic forms, lists, and client-server requests. This chapter focuses on how to present a result set after a user searches or applies filters. The goal is to help users judge results quickly, understand why they appeared, and recover when the list is not useful.
Give the result set a clear identity
Start with a summary that connects the list to the user's action. State the number of results and the active query or context.
For example:
- 24 results for “boots”
- 8 products in Hiking, sorted by price
- No orders found for March 2026
Use a live status message when the result count changes. This gives screen-reader users the same feedback that sighted users receive visually.
<form role="search" action="/search" method="get">
<label for="q">Search products</label>
<input id="q" name="q" type="search" autocomplete="off">
<button type="submit">Search</button>
</form>
<p role="status" aria-live="polite">24 results for "boots"</p>Keep the summary near the result heading. Do not make users infer the current state from the cards alone.
Choose a useful result structure
A result should expose the information needed for the next decision. The right structure depends on the item type and the user's task.
| Result type | Useful primary information | Suitable presentation |
|---|---|---|
| Products | Image, name, price, availability | Card grid or compact list |
| Documents | Title, type, date, matching text | Stacked list |
| People | Name, role, team, contact action | List with clear actions |
| Records | Several comparable fields | Table |
Give every result a consistent hierarchy:
- A clear, clickable title.
- The most important identifying details.
- Supporting metadata, such as date, category, or location.
- An action, if one is needed.
Do not hide essential differences in hover states or rely only on color. Users should be able to scan titles and key values without opening every result.
Explain relevance without overwhelming users
Search results should make the match visible. Highlight matching terms in titles or excerpts, but preserve readable word boundaries. Highlighting every occurrence can make text noisy.
An excerpt should include enough surrounding text to explain the match. If a document matches because of a hidden field, show a useful reason such as “Matches in author” or “Filtered by department.”
Use stable labels for states such as unavailable, archived, or out of stock. Put these labels close to the item they describe. A badge should add information, not replace the item's name.
Support scanning and changing direction
Keep the result layout stable while users move between pages or update filters. Avoid shifting the position of major controls when the count changes. Preserve the user's query and applied filters so returning to the list does not erase their work.
If the list is long, use pagination or incremental loading deliberately. Pagination helps users understand position and return to a previous page. Incremental loading reduces interruption but can make the browser's back button and page position harder to manage. Whichever pattern you choose, provide a visible loading state and preserve already displayed results.
Exercise
Exercise
A document search shows a title, a file icon, and a “View” link, but users cannot tell why each document matched. What should you add?
Show answer
Add a readable excerpt or match reason, such as highlighted matching text or “Matches in author.” Keep the title and action clear so users can scan and decide quickly.