Search patterns suggest methods for finding information quickly and easily within a site or application.
A type ahead search gives real-time suggestions to users as they type in the search bar.
Provide instant suggestions as users type in the search query. The suggestions should update dynamically to reflect the most relevant and recent options.
Use visual cues to differentiate and highlight the suggested options from the user's input.
A basic search lets users input a term associated with information they are looking for and the user is then routed to a results page.
If the information is easily accessible through other navigation options, e.g. links or pagination.
Consider the reading direction of your target audience (left to right or right to left) and design the search field accordingly.
UA magnifying glass icon along with placeholder text should indicate the field is intended for search. Avoid using a label to identify a search field.
An optional scope filter allows users to search within a category to provide fewer, more specific results.
When users select the search field, they are presented with recent searches. These are replaced by search suggestions as they start typing.
A results page displays search results related to a search query in a structured format.
If a search returns no results, provide suggestions and assistance to the user to aid their search. An empty state can assist users in this situation.
Provide sorting options to allow users to reorder the search results based on different criteria, such as relevance, date, popularity or alphabetical order.
Provide filters when there is a large number of results to display so that users can refine their search.
If there is a large number of results, provide pagination, a load more button or infinite scrolling to aid navigation and improve load times.
Shell DS components are programmatically determinable with appropriate semantic markup and are designed to meet colour contrast requirements. If you’re not using Shell DS code, you will need to cover the accessibility considerations for each component in this pattern.
If the search is one of the main functionalities it should be marked as a landmark for assistive technologies. Make sure the input is identifiable and understandable by AT by providing information of what the context the user is gonna be searching on.
Markup the search results using appropriate HTML elements. For example, use article or li for individual search result items and h2 for the result titles. This helps assistive technologies and search engines to understand the structure and hierarchy of the content.
Use aria-label to provide alternative text for elements that lack visible labels, or aria-live to announce dynamic updates in search results, such as real-time filtering.
Make sure the input is marked as input[type=”search”].
Help us to help you by contacting the Accessibility team for support and information regarding any questions relating to accessibility.
Is this page useful for you?
Your feedback helps to improve our documentation.