This widget is and is subject to change in minor versions.
Signature
Import
JavaScript
About this widget
Use the<FilterSuggestions /> widget to display relevant facet filter suggestions powered by Algolia AI agents.
Suggestions are based on the current , refinements, and context.
Clicking a suggestion applies the corresponding filter.
See also: Algolia AI Agents
To create this agent, choose the Filter suggestions template in the Agent Studio dashboard. The model used should be a faster, cheaper one (for example gpt-4.1-mini), as suggestions don’t require deep reasoning.
Example
JavaScript
Props
The unique identifier of the agent to connect to. You can find the
agentId in the Agent Studio dashboard.JavaScript
A custom transport object to handle the communication between the widget and the agent. The API endpoint must be compatible with Vercel AI SDK 5.
JavaScript
Restrict suggestions to these facet attributes.
JavaScript
Maximum number of suggestions to display. Default: 3.
Debounce delay before fetching suggestions, in milliseconds. Default: 300.
Number of hits to send for context. Default: 5.
Transform the suggestions before rendering.
JavaScript
Custom component to render each suggestion.
JavaScript
Custom or disable header.
JavaScript
Custom component for empty state.
JavaScript
The CSS classes you can override and pass to the widget’s elements.
It’s useful to style widgets with class-based CSS frameworks like Bootstrap or Tailwind CSS.
root: The root element of the widget.loadingRoot: The root element when loading.emptyRoot: The root element when empty.header: The header section.headerIcon: The sparkles icon in the header.headerTitle: The title text in the header.skeleton: The skeleton container when loading.skeletonItem: Each skeleton placeholder item.list: The list of suggestions.item: Each suggestion item.button: The button for each suggestion.label: The label text for each suggestion.count: The count for each suggestion.
JavaScript
Any
<div> prop to forward to the root element of the widget.JavaScript