Search
The search feature lets users find specific information within a website. They can use search as an alternative to navigation. Or they may need to use it if they get stuck in the navigation.
Search uses metadata to filter content for the user. Search then presents results to the user that are relevant to their search query.
When to use
- Use for large sites that have a variety of content.
- Use for sites that have a navigation structure that is complex or hierarchical.
When not to use
- Don’t use a search component on small sites with minimal content. Instead, rely on navigation.
Open all
Open all
- Ensure users can access and operate search using only keyboard controls.
- Have a high color contrast between the search bar and the background.
- Include extra guidance with
aria-describedby
for screen readers when using predictive text.
- Place the search bar in the upper right corner. This lets users identify it for quick access.
- Make search responsive across devices and screen sizes.
- Give clear and helpful feedback when search fails to provide useful results. Avoid jargon like "404 page not found." Instead use a kind message that doesn’t blame the user.
- Use predictive text or suggestions when possible. This will help users refine their search queries.