Build search interfaces
Build search interfaces
|
Atomic for Commerce components are in open beta and remain under active development. Atomic for Commerce hasn’t yet gone through a formal accessibility review. If you have accessibility needs, contact your customer success manager and we’ll work with you to address them. |
All commerce search interfaces in Atomic use the atomic-commerce-search-box
component, which is the main building block that provides search box functionality.
To work properly, it must be placed inside a atomic-commerce-interface
with the type
attribute set to search
(the default value).
You can find a complete example of a search page in Storybook.
Prerequisites
Before you begin building your search interface, make sure you understand how to:
Search box component
The search box component is the core of your search interface. It lets users perform product searches by typing and submitting a query. It features built-in support for query suggestions and optional redirection to a search page. For the best user experience, the search box should be clearly visible, typically placed in the upper-center or upper-right section of a page.
You can add the following components as children of the atomic-commerce-search-box
component:
-
atomic-commerce-search-box-query-suggestions
: This component displays query suggestions as the user types. -
atomic-commerce-search-box-instant-products
: This component displays instant products as the user types. -
atomic-commerce-search-box-recent-queries
: This component displays recent queries as the user types.
Standalone search box
When using the atomic-commerce-search-box
component on non-search pages, you can add the redirection-url
property to create a standalone search box.
The search box will redirect users to a results page when they submit a query.
Search page
A search page typically consists of a search box and a list of product results, as well as components to filter and navigate the results. Once you know how to build a search box, you can start building a search page. Here is a list of useful Atomic components that can be added to a commerce search page:
-
atomic-commerce-product-list
: This component fetches and displays products. -
atomic-commerce-facets
: This component renders facets that let users filter results by category or by attributes such as product price or color. -
atomic-commerce-sort-dropdown
: This component renders a dropdown that lets users choose how to sort query results, such as by relevance, date, or product price. -
atomic-commerce-pager
: This component renders a pager that lets users navigate through paginated product results. -
atomic-commerce-query-summary
: This component displays information about the current set of products being shown, such as "Products 1-10 of 123".