Skip to content

component/pillbox

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pillbox

Pillbox input component, a fork of tomerdmnt/tag-input.

Tags Input

Install

$ component install component/pillbox

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, options)

Initialize with the given input element and options. Available options include:

  • lowercase: all added tags get converted to lowercase.
  • allowSpace: allow spaces in tags.
  • space: inverse of allowSpace (backwards support).

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

About

Tokenized text input for "tags"

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.2%
  • CSS 5.8%