Skip to content

searchcraft-popover-form

This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.

import { SearchcraftPopoverForm } from "@searchcraft/react-sdk";
index.html
<searchcraft-popover-form type="inline" />
index.js
const popoverForm = document.querySelector('searchcraft-popover-form');
popoverForm.popoverResultMappings = {};
PropertyAttributeDescriptionTypeDefault
hotkeyhotkeyThe hotkey that activates the popover.string | undefined'k'
hotkeyModifierhotkey-modifierThe hotkey modifier that activates the popover. Used together with the hotkey prop."alt" | "ctrl" | "meta" | "option" | undefined'meta'
placeholderBehaviorplaceholder-behaviorThe placeholder’s render behavior. ‘hide-on-focus’ - Hide the placeholder text immediately when the input form gains focus. ‘hide-on-text-entered’ - Only hide the placeholder when the input form has text entered into it."hide-on-focus" | "hide-on-text-entered" | undefinedundefined
placeholderValueplaceholder-valueThe input element’s placeholder value.string | undefined'Enter Search'
popoverResultMappingsFormats the content rendered for each result.undefined | { title?: SearchResultMapping | undefined; subtitle?: SearchResultMapping | undefined; imageSource?: SearchResultMapping | undefined; imageAlt?: SearchResultMapping | undefined; href?: SearchResultMapping | undefined; }undefined
searchcraftIdsearchcraft-idThe id of the Searchcraft instance that this component should use.string | undefinedundefined
showSummaryBoxshow-summary-boxWhether to display the AI generative summary box before the search results. NOTE: This requires the usage of a read key that has “SUMMARY” permissions and either a subscription to Searchcraft Cloud with AI features enabled or a self-hosted model connected.boolean | undefinedfalse
typetypeThe type of popover form to render. - inline - Renders inline with the rest of the content on the page. The search results pop over the page content. - fullscreen - Renders in fullscreen view. Used together with the searchcraft-popover-button component. - modal - Renders in a modal view. Used together with the searchcraft-popover-button component."fullscreen" | "inline" | "modal" | undefined'inline'
viewAllResultsBaseUrlview-all-results-base-urlBase URL for the “View all” footer link. The current search term will be appended (URL encoded). For example, in a CMS-backed site you might set this to /?s= so the final URL becomes /?s=<search-term>.string | undefinedundefined
viewAllResultsLabelview-all-results-labelOptional label for the “View All” footer button. Defaults to “View All”.string | undefinedundefined