0.1.2 • Published 4 years ago

react-eos-account-input-autocomplete v0.1.2

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

:writing_hand: react-eos-account-input-autocomplete

Simple React component that implements the auto-completion of account names on the EOS Blockchain.

 


 

:page_with_curl: Installation

npm install react-eos-account-input-autocomplete

 


 

:rocket: Usage

  import EosAccountInputAutocomplete from 'react-eos-account-input-autocomplete'

  const [value, setValue] = useState('')

  ....

  <EosAccountInputAutocomplete 
    value={value}
    limit={5} //default to 10
    rpc={'your rpc address or an instance of JsonRpc'}
    onChange={_e => setValue(_e.target.value)}
    onSelect={_value => setValue(_value)}
    onFetchAccounts={_accounts => console.log(_accounts)}
  />

 


 

:performing_arts: Customization

It's possible to override the css classes (by default they are empty):

  • `eos-account-input-autocompleteinput`__: input text
  • `eos-account-input-autocompletelist`__: list container
  • `eos-account-input-autocompleteitem`__: single item within the list