@comparaonline/ui-autocomplete-textfield
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

@comparaonline/ui-autocomplete-textfield

Installation

yarn add @comparaonline/ui-autocomplete-textfield

Usage

const items = [{
  label: "item1",
  value: 1
}, {
  label: "item2",
  value: 2
}];

<AutoCompleteTextField
  items={items}
  getItemLabel={item => item.label}
  getItemValue={item => item.value}
  textFieldProps={{
    fullWidth: true,
    label: 'Select car model',
    variant: 'outlined'
  }}
  suggestionProps={{
    noResultsText: 'No results',
    maxDisplayedItems: 10
  }}
/>

Component Props

name type required description
items any true list of items to display
getItemLabel function: item => string true receive an item an return its label
getItemValue function: item => string true receive an item an return its value
suggestionProps object true autocomplete configuration
textFieldProps object false props used by material-ui Textfield
searchOptions object false configuration options used by fuse.js

suggestionProps

name type required default description
noResultsText string true text to display when there are not suggestions
maxDisplayedItems number false 5 max number of suggestions to display

Readme

Keywords

none

Package Sidebar

Install

npm i @comparaonline/ui-autocomplete-textfield

Weekly Downloads

66

Version

0.3.0

License

none

Unpacked Size

56.9 kB

Total Files

18

Last publish

Collaborators

  • gnavarro
  • dsuarez_compa
  • pfariaz
  • ricardo.sosa
  • suarezcumare
  • fverag
  • comparaonline-dev
  • comparaonlineprivate
  • matotias
  • javierlara1989
  • smurua
  • eseceve
  • pablocompara