React Inline Autocomplete
Installation
yarn add react-inline-autocomplete
or
npm install react-inline-autocomplete --save
Remember to import react-inline-autocomplete/dist/index.css
to your project.
Demo
Live demo: Protal
How to use
;;; ;
Props
Property | Type | Default | Required | Description |
---|---|---|---|---|
value | string | undefined | no | input value |
dataSource | DataSourceItem | [] | yes | Array of available items to search. |
className | string | "" | yes | |
style | React.CSSProperties | undefined | no | |
placeholder | string | undefined | no | |
disabled | boolean | false | no | Whether to disable, the default is false. |
caseSensitive | boolean | true | no | |
navigate | boolean | true | no | You can switch auto-complete when navigate is true. |
onBlur | () => void | undefined | no | onBlur handler |
onFocus | () => void | undefined | no | onFocus handler |
onChange | (value: string) => void | undefined | no | onChange handler |
onPressEnter | (value: string) => void | undefined | no | onPressEnter handler(called when you press Enter ) |
onSelect | (item: DataSourceItem) => void | undefined | no | onSelect handler(called when you press Tab ) |
Development
yarnyarn dev
cd exampleyarnyarn start
Open http://localhost:3000
.
Build & Publish
yarn
yarn build
npm publish
cd example
yarn
yarn build
cd ..
yarn deploy
License
MIT