1.4.1 • Published 4 years ago

@gluedigital/autocomplete v1.4.1

Weekly downloads
9
License
MIT
Repository
-
Last release
4 years ago

Autocomplete

A very simple autocomplete component with no dependencies.

Usage

To install it:

npm install --save @gluedigital/autocomplete

To use it:

import Autocomplete from '@gluedigital/autocomplete'
import '@gluedigital/autocomplete/css/autocomplete.css'
const values = ['Alice', 'Bob', 'Carol']

// ...

<form>
  <Autocomplete values={values} name="my-field-name" required />
</form>

Options

The following props can be used:

NameTypeDescription
namestringThe name to use on the internal input
valuesarrayThe allowed values
valueLabelstring or functionIf the values are not strings, the field to use as label, or a function to generate it
requiredboolWhether the input should have the required flag
autoFocusboolWhether the input should have the autoFocus flag
noResultsTextstringA message for the dropdown when there are no results
placeholderstringA placeholder shown when the input is empty
valuestringThe preselected value
onChangefuncA function that will be called when the selection changes
withClearboolWhether to show a clear button

Developing

This package uses nwb for the build. Take a look at their documentation for more info.

TL;DR: after installing nwb, just do npm start to open the dev environment.

1.4.1

4 years ago

1.4.0

4 years ago

1.3.2

5 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago