Skip to main content

React

The GuidesHeadlines widget lets you reference and render different guides on your website.

Installation

The Algolia Guides React package is available on the npm registry.

Usage

React

Parameters

client
GSEClient
required
The initialized Algolia Generative Experiences client.
category
string
required
The category used for retrieving the headlines.
maxHeadlines
number
default:4
The number of headlines to display (between 1 and 1000).
onlyPublished
boolean
default:true
Whether to only return headlines with generated content.
showImmediate
boolean
default:true
Whether to generate and display the headlines on load.
showFeedback
boolean
default:false
Whether to show the feedback widget. If true, you also need to provide a userToken.
userToken
string
The user token needed for computing feedback. Required if showFeedback is true.
searchParams
SearchParamsObject
Search parameters that are applied when fetching headlines. Can be used for pagination or custom filtering.Not all search parameters are supported. Some parameters are ignored to ensure the correct functioning of the widget: facetFilters, hitsPerPage, optionalFilters, attributesToHighlight and getRankingInfo.For more information, see API parameters.
children
(props: ChildrenProps) => JSX.Element
A render function to fully customize what’s displayed.The default implementation is:
React
view
ViewProps
The view component into which your guide headlines will be rendered.The default implementation is:
React
itemComponent
({ item, createElement, Fragment, html }) => JSX.Element | VNode | VNode[]
Component to display the headlines.
classNames
HeadlinesButtonClassNames
The class names for the component.
TypeScript

JavaScript

The guidesHeadlines widget lets you reference and render different guides on your website.

Installation

The Algolia Guides JavaScript package is available on the npm registry.

Usage

JavaScript

Parameters

client
GSEClient
required
The initialized Algolia Generative Experiences client.
category
string
required
The category used for retrieving the headlines.
maxHeadlines
number
default:4
The number of headlines to display (between 1 and 1000).
onlyPublished
boolean
default:true
Whether to only return headlines with generated content.
showImmediate
boolean
default:true
Whether to generate and display the headlines on load.
showFeedback
boolean
default:false
Whether to show the feedback widget. If true, you also need to provide a userToken.
userToken
string
The user token needed for computing feedback. Required if showFeedback is true.
children
(props: ChildrenProps) => JSX.Element
A render function to fully customize what’s displayed.The default implementation is:
JavaScript
view
ViewProps
The view component into which your guide headlines will be rendered.The default implementation is:
JavaScript
itemComponent
({ item, createElement, Fragment, html }) => JSX.Element | VNode | VNode[]
Component to display the headlines.
classNames
HeadlinesButtonClassNames
The class names for the component.
TypeScript
Last modified on May 19, 2026