The Coveo Atomic library provides you with a customizable set of UI components that are already configured to communicate with the Coveo Platform. These web components, which are built on top of the Coveo Headless library, can be used with or without existing frameworks.

To create a starter Coveo Atomic project, check out the Coveo CLI. The CLI allows you to quickly set up a project that uses the Netlify CLI development tool.

This article provides an overview of the core Atomic concepts.

Install Atomic


The simplest way to get the Atomic component library is through a content delivery network (CDN).

Include the following scripts in the target HTML page:

</script> (1)
    href=""/> (2)
1 The main framework script.
2 The default stylesheet for the framework. While this import is optional, if you don’t import it you will need to define its variables yourself.

CDN links are available for the following versions of Atomic releases:


Recommended for development and QA environment purposes. It’s a rather safe way to always have recent features from minor version updates, while not having major breaking changes.


Recommended for production and any customer facing app. Minor version updates are mostly bug fixes; pointing to a minor version is safe and retrieves patches instantly.


The library is also available as an npm package.

npm install @coveo/atomic

All of the resources will be available under /node_modules/@coveo/atomic/dist/atomic. You can include those in target pages with <script> tags.

If you’re using a module bundler (Browserify, Webpack, Rollup, etc.), you can use require('@coveo/atomic') or import '@coveo/atomic'.

Use Components to Create a Search Interface

Atomic builds search pages by attaching components to target HTML elements.

This means you can build your search page by assembling the target HTML elements:

  <atomic-search-interface id="search">
      <atomic-facet field="author" label="Authors"></atomic-facet>
      <!-- ... -->
    <!-- ... -->

Then, to turn those HTML elements into real Atomic components, you use a script to initialize the overarching atomic-search-interface component:

    (async () => {
      await customElements.whenDefined('atomic-search-interface');
      const searchInterface = document.querySelector('#search');
      await searchInterface.initialize({
        accessToken:'<ACCESS_TOKEN>', (1)
        organizationId: '<ORGANIZATION_ID>' (2)
  <!--- ... --->


1 <ACCESS_TOKEN> (string) is an API key or search token that grants the Allowed access level on the Execute Queries domain, as well as the Push access level on the Analytics Data domain in the target organization.
2 <ORGANIZATION_ID> (string) is the unique identifier of your Coveo organization (e.g., mycoveoorganizationa1b23c).

Several components expose options. For example, the following search box will offer a maximum of two queries when the user interacts with it:

<atomic-search-box number-of-queries="2"></atomic-search-box>

For more details about the properties of the atomic-search-box component, see the Reference Documentation for that component.

Some components also expose methods:

const searchInterface = document.querySelector("atomic-search-interface");
await searchInterface.initialize({
  accessToken: "xx564559b1-0045-48e1-953c-3addd1ee4457",
  organizationId: "searchuisamples"
}); (1)
searchInterface.executeFirstSearch(); (2)
1 As seen in the example above, the initialize method is used to initialize the interface. In this case, use the await operator to wait for the interface initialization to complete before moving on.
2 The executeFirstSearch method this then used to trigger a search after initializing the interface. For more information about the atomic-search-interface methods, see the Reference Documentation.

Style Your Components

Atomic uses shadow DOM to instantiate components. This encapsulates a specific section of the DOM to allow for componentization, meaning that the component style is independent from the surrounding DOM styling. As such, you must style those components using their shadow DOM parts. For example:

  atomic-facet::part(label-button) {
    justify-content: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--atomic-neutral)

For more detailed guide on how to customize your components, please refer to this article.

What’s Next?

Result templates determine the format of the individual query results in a search interface. When a query is successful, each result is rendered according to the first template whose condition is satisfied by that result.

Atomic currently provides one default template for all result types. More will be added in the future.

You can also create your own result templates with custom styles. Learn more about creating result templates in this article.

What's Next for Me?