0.0.4 • Published 6 years ago

react-textarea-autocomplete v0.0.4

Weekly downloads
193
License
MIT
Repository
github
Last release
6 years ago

React Textarea Autocomplete

Installation

npm install react-textarea-autocomplete

DEMO

Usage

import React, { Component } from 'react'
import TextareaAutocomplete from 'react-textarea-autocomplete'

class App extends Component {
  render () {
    const fruts = [
      'tacos',
      'blackberry',
      'watermelon',
      'kiwi',
      'chili',
      'lemon',
      'orange',
      'pineaple'
    ]

    return (
      <div>
        <TextareaAutocomplete
          list={fruts}
          char='#'
        />
      </div>
    )
  }
}

PropTypes

Prop NameTypeDefaultDescription
listArray List of items ans suggest
minCharNumber2Min characters for trigger after the char #
charString#Character of search, example #
maxSuggestNumber Max lenght of items in suggest
modeStringinfiniteBehavior in key navegations infinitelock
addCharBooleantrueAdds the character in textarea when is selected
limitToParentBooleanfalseRestrict ul list position in the parent's width
showCharInListBooleantrueAdds the character in the select list
spellcheckBooleanfalseSpellcheck in textarea
listClassString""Custom class css in the ul list
activeItemClassString""Custom class css in the li item active
inactiveItemClassString""Custom class css in the li item inactive
activeItemStyleObject{ }Styles in active item
inactiveItemStyleObject{ }Styles in inactive item
charStyleObject{ }Char styles in the item

This component uses Standard JS

JavaScript Style Guide

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

1.1.0

7 years ago