React Textarea Autocomplete
Simple React Textarea component for autocomplete hashtags, tags etc.
Installation
npm install react-textarea-autocomplete
DEMO
Usage
{ const fruts = 'tacos' 'blackberry' 'watermelon' 'kiwi' 'chili' 'lemon' 'orange' 'pineaple' return <div> <TextareaAutocomplete list=fruts char='#' /> </div> }
PropTypes
Prop Name | Type | Default | Description |
---|---|---|---|
list | Array | [ ] | List of items ans suggest |
minChar | Number | 2 | Min characters for trigger after the char # |
char | String | # | Character of search, example # |
maxSuggest | Number | [ ] | Max lenght of items in suggest |
mode | String | infinite | Behavior in key navegations infinite |
addChar | Boolean | true | Adds the character in textarea when is selected |
limitToParent | Boolean | false | Restrict ul list position in the parent's width |
showCharInList | Boolean | true | Adds the character in the select list |
spellcheck | Boolean | false | Spellcheck in textarea |
listClass | String | "" | Custom class css in the ul list |
activeItemClass | String | "" | Custom class css in the li item active |
inactiveItemClass | String | "" | Custom class css in the li item inactive |
activeItemStyle | Object | { } | Styles in active item |
inactiveItemStyle | Object | { } | Styles in inactive item |
charStyle | Object | { } | Char styles in the item |
This component uses Standard JS