Type alias Item

Item: {
    value: string;
    searchMatch?: string;
    label?: string;
    image?: string;
    [key: string]: unknown;
}

Definition for a suggestion item

Type declaration

  • [key: string]: unknown

    Items can be enhanced with custom properties, particularly useful if you are implementing a custom dropdown item slot

  • value: string

    The value to insert when the suggestion is selected. By default, the trigger is not included so add it if needed

  • Optional searchMatch?: string

    The part of the item that matches the search (by default, case-insensitive and substring match)

    Default

    {value}
    
  • Optional label?: string

    An optional label to show in the suggestion instead of the value

    Default

    {value}
    
  • Optional image?: string

    An optional image to show in the suggestion