Giter Club home page Giter Club logo

redbadger-pillbox's Introduction

This repository is a mirror of the component module redbadger/pillbox. It has been modified to work with NPM+Browserify. You can install it using the command npm install npmcomponent/redbadger-pillbox. Please do not open issues or send pull requests against this repo. If you have issues with this repo, report it to npmcomponent.

Pillbox

Pillbox input component, a fork of component/pillbox, which itself is a fork of tomerdmnt/tag-input.

Adds autocomplete support to the pillbox. You can only allow whitelisted tags, or just use the autocomplete as suggestions.

Tags Input

Autocomplete does not support server round trip completion at th emoment.

How to use

This is a component component. You can easily plug it into your site or web app. Check the example of usage in test/index.html. To get things working, follow these easy steps (assuming you already have Node.js and npm installed):

  • npm install -g component
  • Clone this repository and navigate into the component folder
  • Run component install to fetch dependencies
  • Run component build
  • Now you can open test/index.html and if everything is fine you should be able to see the component in action

If your app already uses components, you can simply run component install redbadger/pillbox - this will fetch and install all dependencies into /components folder of your project.

Example

var Pillbox = require('pillbox');

var input = Pillbox(document.getElementById('tags'))

input.on('add', function(tag){
  console.log(tag + ' added');
});

input.on('remove', function(tag){
  console.log(tag + ' removed');
});

Events

  • add (tag)
  • remove (tag)

API

Pillbox(input, possibilities, options)

Initialize with the given input element, possible tags possibilities and options. Available options include:

  • lowercase: all added tags get converted to lowercase.
  • strict: only allow tags listed in possibilities

Pillbox#add(tag)

Add tag string if it does not already exist.

Pillbox#remove(tag)

Remove tag string if it exists.

Pillbox#values([array])

Set / Get the tags.

License

MIT

redbadger-pillbox's People

Contributors

tj avatar tomerdmnt avatar yields avatar charypar avatar matthewmueller avatar asavin avatar jonathanong avatar kelonye avatar airportyh avatar

Watchers

James Cloos avatar npm <3 component 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.