Skip to content

searchcraft-popover-button

Renders a button which, when clicked, turns on popover visibility.

import { SearchcraftPopoverButton } from "@searchcraft/react-sdk";
index.html
<searchcraft-popover-button>
Open popover
</searchcraft-popover-button>
index.js
const popoverButton = document.querySelector('searchcraft-popover-button');
popoverButton.template = ({ isPopoverVisible }, { html }) => html`
<span>Click me</span>
`;
PropertyAttributeDescriptionTypeDefault
searchcraftIdsearchcraft-idThe id of the Searchcraft instance that this component should use.string | undefinedundefined
templateA callback function responsible for rendering the button contents.((data: { isPopoverVisible: boolean; }, utils: { html: TemplateHtml; }) => string) | undefinedundefined
typetypeThe type of popover button to render."skeuomorphic" | undefinedundefined