GithubHelp home page GithubHelp logo

boffinsdev / react-tagged-input Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tutorialhorizon/react-tagged-input

0.0 8.0 0.0 862 KB

React component to render tags from a text input

License: MIT License

JavaScript 100.00%

react-tagged-input's Introduction

react-tagged-input

A react component that lets you enter text and converts them to tags.

See the component proptypes in the src/ directory any more options.

More docs and features are on the way. Pull requests are welcome.


Install

npm install react-tagged-input

Usage

To make give this component a proper look and feel, you will want to include the these styles and namespace them appropriately using the classes property as shown below to customize them as per your liking.

var React = require('react');
var TaggedInput = require('react-tagged-input');
var mountPoint = document.querySelector('body');

React.render(
  <TaggedInput
    statics={['the hulk', 'spiderman']} // static tags
    addKeys={[TaggedInput.TAB]} // Keys that add tags (FYI Enter is always default)
    removeKeys={[TaggedInput.BACKSPACE]} // Keys that remove tags

    autofocus={true} // Gives the component focus after it mounts
    backspaceDeletesWord={true} // false deletes one character at a time
    placeholder={'Your favorite npm modules'}
    tags={['javascript', 'react']} // pre-assigned tags
    onEnter={/*function*/}
    onAddTag={/*function*/} // argument - tag that was added
    onRemoveTag={/*function*/} // argument - tag that got removed
    unique={true} // Whether duplicate entries are allowed
    classes={'my-css-namespace'}
    removeTagLabel={"\u274C"} // Unicode of a symbol or an Object click to delete tags. Defaults to 'x'
  />,
  mountPoint );

###Dev

Before you begin editing the source component, just run the following grunt task that watches for your changes to the examples as well as the component.

grunt dev

License

MIT

react-tagged-input's People

Contributors

lorefnon avatar ronag avatar simek avatar thmain avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.