Skip to content

fedealconada/react-native-tags

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-Native-Tags

Build Status npm

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

Demo

Installation

npm install react-native-tags
yarn add react-native-tags

Usage

import React from "react";
import Tags from "react-native-tags";

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

PropName Description
initialText The input element's text
initialTags ['the', 'initial', 'tags']
onChangeTags Fires when tags are added or removed
onTagPress Fires when tags are pressed
readonly Removes the TextInput
containerStyle Style
inputStyle Style
tagContainerStyle Style
tagTextStyle Style

About

Tag input component for React Native

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%