@pikas-ui/searchbar

This package contains a searchbar component that can be used to create a searchbar.

This library is based on Radix Ui.

Change Log

Requirements

To use this package, you must install the @pikas-ui/styles package.

Installation

You can install this package using npm, yarn, or pnpm.

npm install @pikas-ui/searchbar
yarn add @pikas-ui/searchbar
pnpm add @pikas-ui/searchbar

Usage

Searchbar

The searchbar component is used to create a searchbar.

No result
import { Searchbar } from '@pikas-ui/searchbar';

const Example: React.FC = () => {
  return <Searchbar />;
};

Props

PropDescriptionTypeDefault
cssThe css of the button.SearchbarCSS-
searchFunctionThe function to call when the search is performed.(value: string) => Promise<T>-
onSearchThe function to call when the search is performed.(value: T) => ResultItem[] or null-
searchTypeThe type of the searchbar."button", "textfield""button"
isOpenThe state of the searchbar.booleanfalse
idThe id of the searchbar.string"searchbar"
searchWhenKeyUpThe state of the searchbar.booleanfalse
debounceDelayThe delay of the searchbar.number500
textfieldThe props of the textfield.TextfieldProps-
noResultThe message when no result is found.ReactNode"No result"
loadingThe message when the search is loading.ReactNode-
directionThe direction of the searchbar.SearchbarDirection-
widthThe width of the searchbar.string or number"100%"
maxWidthThe max width of the searchbar.string or number"100%"
minWidthThe min width of the searchbar.string or number-
openOnFocusSet to true to open the searchbar on focus.booleanfalse

Contributing

This documentation can be edited on GitHub here