react-eos-account-input-autocomplete
v0.1.2
Published
Simple React component that implements the auto-completion of account names on the EOS Blockchain.
Downloads
3
Readme
: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-autocomplete__input
: input texteos-account-input-autocomplete__list
: list containereos-account-input-autocomplete__item
: single item within the list