platform-bible-react
    Preparing search index...

    Interface RecentSearchesProps<T>

    Interface defining the properties for the RecentSearches component

    interface RecentSearchesProps<T> {
        ariaLabel?: string;
        buttonClassName?: string;
        buttonVariant?:
            | "link"
            | "default"
            | "outline"
            | "secondary"
            | "destructive"
            | "ghost";
        classNameForItems?: string;
        getItemKey?: (item: T) => string;
        groupHeading?: string;
        id?: string;
        onSearchItemSelect: (item: T) => void;
        recentSearches: T[];
        renderItem?: (item: T) => string;
    }

    Type Parameters

    • T
    Index

    Properties

    ariaLabel?: string

    Aria label for the recent searches button

    buttonClassName?: string

    Class name for the trigger button. Defaults to absolute positioning inside an input field. Pass a custom value to render the button standalone (e.g. "tw-h-9 tw-w-9")

    buttonVariant?:
        | "link"
        | "default"
        | "outline"
        | "secondary"
        | "destructive"
        | "ghost"

    Variant for the trigger button. Defaults to "ghost"

    classNameForItems?: string

    Class name for styling the CommandItem for each recent search result

    getItemKey?: (item: T) => string

    Function to create a unique key for each item

    groupHeading?: string

    Heading text for the recent searches group

    id?: string

    Optional ID for the popover content for accessibility

    onSearchItemSelect: (item: T) => void

    Callback when a recent search item is selected

    recentSearches: T[]

    Array of recent search items

    renderItem?: (item: T) => string

    Function to render each search item as a string for display