Search Bar

The Search Bar component is used to show filtered data.

1. Import

KUMUI exports 1 SearchBar-related components:

import { SearchBar } from "@rohitgadekar/kimui";

2. Usage


    3. API

    Attribute Type Description Default
    items
    Array<Object>
    An array of items to search through. Each item can contain any fields (e.g., name, role). -
    onItemSelect
    (selectedItem: Object) => void
    A callback function triggered when an item is selected. It receives the selected item as an argument. -
    placeholder
    string
    The placeholder text displayed in the search bar. "Search users..."
    searchKeys
    Array<string>
    Defines which keys of the items to search within. For example, ["name", "role"]. ["name", "role"]
    maxResults
    number
    The maximum number of results to display in the search dropdown. 5