1.0.1 • Published 5 years ago
react-multi-autocomplete v1.0.1
React Multi Autocomplete
Installation
yarn add react-multi-autocompleteor if you use npm
npm install --save react-multi-autocompleteUsage
import React from "react";
import Autocomplete from "react-multi-autocomplete";
const Form = () => {
const onSubmit = input => {
// Logic
};
return (
<Autocomplete
onSubmit={onSubmit}
autocompletions={{
"@": ["John", "Lisa", "Matt"],
"#": ["Outdoor", "Food", "Gaming"],
}}
>
<Autocomplete.input placeholder="What did you do today?" />
<Autocomplete.listItem
highlightedStyle={{
backgroundColor: "#EEEEEE",
}}
/>
</Autocomplete>
);
};Development
Workflow
yarn startThis builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.
Storybook
yarn storybookThis loads the stories from ./stories.
Tests
Tests are setup with Jest
yarn testBuild
yarn buildLicense
MIT © thomasrogerlux