1.0.1 • Published 2 years ago
react-autosuggest-inside-input v1.0.1
React Autosuggest Inside Input
This package is a simple React component that provide autosuggest feature inside an input like below. It is inspired by the browser's address bar.
Installation
To install, you can use npm or yarn:
npm
npm install react-autosuggest-inside-input
yarn
yarn add react-autosuggest-inside-input
Usage example
import AutoSuggestInsideInput from "react-autosuggest-inside-input";
import { useState } from "react";
const suggestions = ["www.google.com", "www.github.com", "www.npmjs.com"];
function App() {
const [value, setValue] = useState("");
return (
<AutoSuggestInsideInput
suggestions={suggestions}
value={value}
setValue={setValue}
/>
);
}
Props
Name | Type | Optional | Description |
---|---|---|---|
suggestions | string array | false | List of suggestions, the input will show the the first match of this array |
value | string | false | Input value |
setValue | (newValue) => void | false | Callback to set the value |
className | String | true | Class name to style the input |
Customization
If you think this is what you need but you want some customization, feel free to copy the code directly from this link :).
License
1.0.1
2 years ago
1.0.0
2 years ago
0.1.13
2 years ago
0.1.14
2 years ago
0.1.15
2 years ago
0.1.16
2 years ago
0.1.17
2 years ago
0.1.18
2 years ago
0.1.12
2 years ago
0.1.11
2 years ago
0.1.10
2 years ago
0.1.9
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago