Searchbar
The fastest way to ship a beautiful searchbar.

Drop-in searchbar
The Search component gives you an elegant searchbar out of the box.
import "@etoile-dev/react/styles.css"; // apply default theme (optional)
import { Search } from "@etoile-dev/react";
export default function App() {
return (
<Search
apiKey={process.env.NEXT_PUBLIC_ETOILE_PUBLIC_KEY}
collections={["paintings"]}
/>
);
}Use your public key for client-side search.
Searchbar props
| Parameter | Type | Description |
|---|---|---|
apiKeyrequired | string | Your public API key. |
collectionsrequired | string[] | Collections to search. |
limit | number | Max results (default: 10). |
Custom searchbar
For full control, compose your own searchbar with primitives.
import {
SearchRoot,
SearchInput,
SearchResults,
SearchResult,
} from "@etoile-dev/react";
export default function CustomSearch() {
return (
<SearchRoot
apiKey={process.env.NEXT_PUBLIC_ETOILE_PUBLIC_KEY}
collections={["paintings"]}
limit={20}
>
<SearchInput placeholder="Search paintings..." />
<SearchResults>
{(result) => (
<SearchResult>
<h3>{result.title}</h3>
<p>{result.metadata.artist}</p>
</SearchResult>
)}
</SearchResults>
</SearchRoot>
);
}Components
SearchRoot— Context provider for search stateSearchInput— Input with ARIA combobox roleSearchResults— Results container with listbox roleSearchResult— Individual result with option role
Next
- Styling — theme or custom UI
- Hooks — build custom UI
- Search (POST) — API reference