Home > @findkit/ui > FindkitUI

FindkitUI class

The Lazy loading Findkit UI

https://docs.findkit.com/ui/api/

Signature:

export declare class FindkitUI<G extends FindkitUIGenerics = FindkitUIGenerics, O extends FindkitUIOptions<G> = FindkitUIOptions<G>, E extends FindkitUIEvents<G, O> = FindkitUIEvents<G, O>> 

Constructors

Constructor Modifiers Description
(constructor)(options) Constructs a new instance of the FindkitUI class

Properties

Property Modifiers Type Description
activateGroup (groupId: string | number | { id: string | number; }) => void Activate group by id, index or group object. Does not open the modal. Use with open() to open the modal as well.
addTranslation (lang: string, translation: Partial<TranslationStrings>, custom?: Record<string, string> | undefined) => void

Set the UI translations transt for a given language

https://docs.findkit.com/ui/api/#addTranslation

lang - language code translations - translations object custom - Additional custom translations when using the useTranslator in slot overrides

clearGroup () => void Clear possibly active group by returni the multiple groups view
close () => void

Close the modal

https://docs.findkit.com/ui/api/#close

container? Element (Optional) The container element. Available after the "loaded" event.
groups readonly GroupsOrDefault<G, O>
id readonly string The instance id
params readonly SearchParamsOrDefault<G, O> https://docs.findkit.com/ui/api/#params
preload () => Promise<void>
setCustomRouterData (data: NonNullable<G["customRouterData"]>) => void
setLang (lang: string) => void

Set the current UI language

https://docs.findkit.com/ui/api/#setLang

updateGroups (arg: UpdateGroupsArgument<GroupsOrDefault<G, O>>) => void Update groups
updateParams (arg: UpdateParamsArgument<SearchParamsOrDefault<G, O>>) => void Update search params

Methods

Method Modifiers Description
bindInput(selector)
dispose() Unbind all event listeners, close the modal and remove it from the DOM
on(eventName, handler) Bind an event handler to the emitter
once(eventName, handler) Bind an event handler to the emitter
open(terms, options) https://docs.findkit.com/ui/api/#open
openFrom(selector)

Open the modal from the given elements. If a string is given it is used as a query selector to find the elements after the DOMContentLoaded event.

Element is not added to the focus trap automatically. If the element is visible on the page when the modal is open .focus() should be manually called on the element.

The FindkitUI implementation is preloaded on mouseover.

https://docs.findkit.com/ui/api/#openFrom

search(terms) https://docs.findkit.com/ui/api/#search
status() https://docs.findkit.com/ui/api/#status
terms() The search terms used on the last search
toggle() https://docs.findkit.com/ui/api/#togggle