Skip to content

searchcraft-results-info

This web component is designed to display the number of results returned from a search query.

import { SearchcraftResultsInfo } from "@searchcraft/react-sdk";
index.html
<searchcraft-results-info />
index.js
const resultsInfo = document.querySelector('searchcraft-results-info');
resultsInfo.template = (info, { html }) => html`
${info.range[0]}-${info.range[1]} of ${info.count} results in ${info.responseTime}ms
`;
PropertyAttributeDescriptionTypeDefault
searchcraftIdsearchcraft-idThe id of the Searchcraft instance that this component should use.string | undefinedundefined
templateA callback function responsible for rendering the results info.((data: { range: [number, number]; count: number; responseTime: string; }, utils: { html: TemplateHtml; }) => string) | undefinedundefined