Have ideas to improve npm?Join in the discussion! »

@zhongyangxun/z-auto-complete

1.0.2 • Public • Published

@zhongyangxun/z-auto-complete

A auto-complete component for react.

Qucik Start

installation

yarn add @zhongyangxun/z-auto-complete

Usage

import React from 'react'
import AutoComplete from "@zhongyangxun/z-auto-complete";
 
const onSelect = () => {
  console.log('select');
}
 
const onChange = () => {
  console.log('change');
}
 
const App = () => {
  const options = [
    {
      value: 'a',
    },
    {
      value: 'b',
    }
  ];
 
  return (
    <div className="app">
      <AutoComplete
        onChange={onChange}
        onSelect={onSelect}
        options={options}
      />
    </div>
  );
}
 
export default App;

Document

options

value

The initial value of the auto-complete.

options

The drop down select list.

onSelect

Callback of the drop down select list selected.

onChange

Callback of change event.

onSearch

Callback of input event.

onFocus

Callback of focus event.

onBlur

Callback of blur event.

Install

npm i @zhongyangxun/z-auto-complete

DownloadsWeekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

148 kB

Total Files

37

Last publish

Collaborators

  • avatar