1.0.2 • Published 7 years ago

react-native-tag-textinput v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

React-Native-Tag-TextInput

A React Native component that allows you to input text and formats the text into a tag when comma is entered.

Installation

npm install react-native-tag-textinput --save

Usage

import React from "react";
import Tags from "react-native-tag-textinput";

const UselessComponent = () => (
  <Tags
    initialText="monkey"
    initialTags={["dog", "cat", "chicken"]}
    onChangeTags={tags => console.log(tags)}
    onTagPress={(index, tagLabel, event) => console.log(index, tagLabel, event)}
    containerStyle={{ justifyContent: "center" }}
    inputStyle={{ backgroundColor: "white" }}
  />
);

Props

PropNameDescription
initialTextThe input element's text
initialTags'the', 'initial', 'tags'
onChangeTagsFires when tags are added or removed
onTagPressFires when tags are pressed
readonlyRemoves the TextInput
containerStyleStyle
styleStyle (containerStyle alias)
inputStyleStyle