@coveo/ui-kit-sample-atomic-search-react
v3.11.41
Published
Readme
Atomic Search Sample (React)
Scaffold template:
atomic-search-reactA search interface built with@coveo/atomic-react— the React wrapper for Coveo's Atomic components — bundled with Vite. It runs against the publicsearchuisamplesorganization (theBarcaKnowledgeknowledge base) with no configuration required.
What it shows
- A search box with query suggestions + instant results
- The same facets as the Headless search samples: a hierarchical Category facet (
ec_category) plus Article type, Robot series, Difficulty, and Author - A breadbox, query summary, and a sort dropdown (Relevance / Newest / Oldest)
- A result list with a basic result template and numbered pagination
Technology stack
- @coveo/atomic-react: React components wrapping
@coveo/atomic - @coveo/headless: builds the search engine
- Vite + React: dev server and build
- Playwright: end-to-end tests
Getting started
pnpm install
pnpm dev # start the dev server
pnpm build # production build
pnpm preview # preview the production build (http://localhost:4173)
pnpm e2e # end-to-end tests (Playwright)How it works
src/engine.tsbuilds the search engine fromgetSampleSearchEngineConfiguration()scoped to theBarcaKnowledgesearch hub.src/App.tsxrenders anAtomicSearchInterface(fed that engine) with the Atomic React components.vite.config.jscopies Atomic's runtimeassets/,lang/, andthemes/out of the installed packages intopublic/(the components fetch them at/assets,/lang, and the theme is linked from/themes).
Using this sample as an MRE
This sample doubles as a minimal reproducible example for troubleshooting.
- Where to change the configuration:
src/engine.ts. It usesgetSampleSearchEngineConfiguration()(public sample credentials). Replace it with your ownorganizationId/accessTokenand hub/pipeline. - Safe to modify:
src/engine.tsandsrc/App.tsx. - Scaffolding you can usually ignore:
vite.config.js,playwright.config.ts, ande2e/. - Credentials: the sample configuration targets the public
searchuisamplesorganization, safe to share with customers or partners. It is not internal credentials.
Reproducing against a specific version
npm install @coveo/atomic-react@<version>