Giter Club home page Giter Club logo

react-tag-list's Introduction

react-tag-list Build Status

A "tag list" to illustrate values that are selected, and an api to allow adding and removing these values. This is useful to show things like the state of a filter selector component. This tag list will also intelligently allow you to expand/show more tags when the tag area has become full. Demo It

#Properties

  • values: (Array of Objects each with the label and value properties) These values each become a tag.

  • onRemove: (function(value)) Called when a tag is clicked.

Optional:

  • tagContainerCollapsedHeight: (Number) This is the height in pixels of the tag area when the area is collapsed. Defaults to 55 px.
  • tagContainerExpandedHeight: (Number) This is the height in pixels of the tag area when the area is expanded. Defaults to 150 px.
  • placeholderText: (String) What text to show when there are no tags selected.

JSX:

var tags=[{value: "sweet", label: "Chocolate"},
		  {value: "tart", label: "Strawberry"},
		  {value: "bitter", label: "Lemon"}];

var removeTag = function(tagValue) {
	//update tag values
};

<ReactTagList values={tags} onRemove={removeTag}/>

Development

  • Development server npm run dev.
  • Continuously run tests on file changes npm run watch-test;
  • Run tests: npm test;
  • Build npm run build;

react-tag-list's People

Contributors

alwaysmorehats avatar colinnichols avatar jackcompton avatar tehandyb avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.