The basic preview search widget template

A basic preview search widget template shows search results based on visitor query. Changes in input in the search input field triggers requests to Sitecore Search.

Screenshot of a basic preview search widget.

The following sections describe the basic preview search widget template, and contains an API reference, and instructions on how to create code blocks that you can add to the WidgetsProvider in your React project using Search JS SDK for React. The widget uses the preview search query hook to request and retrieve data.

To create a widget component, you can choose to use Search UI components CLI, a command line interface, or copy and paste code blocks manually.

Generate or create the component

Important

Remember to adjust the entity model in the widget template to match your implementation.

Plain component

Styled component

CSS styled component

CSS module styled component

Component properties

Items per page

defaultItemsPerPage sets the maximum number of items displayed in this component.

Default: 6

RequestResponse
<PreviewSearchBasic
	rfkId="rfkid_6"
 	defaultItemsPerPage={12}
/>

Do you have some feedback for us?

If you have suggestions for improving this article,