Skip to content

mrtcode/tagbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tagbar

Demo

Write tags

Insert/remove tags

  • No dependencies
  • Has an autosuggester
  • Supports touch devices

Usage

Download Tagbar and include tagbar.js and tagbar.css files on your page.

    <link rel="stylesheet" href="tagbar.css">
    <script src="tagbar.js"></script>

Alternatively, you can require it as a module if you use Browserify

    var tagbar = require('./tagbar.js');

Create a tagbar inside a container. Pass an element or element id as a container parameter.

<div id="container-id"></div>
    var tagbar = new Tagbar({
        container: 'container-id',
    });

    tagbar.setTags(['creative', 'holidays']);

    var tags = tagbar.getTags();

Attach event handlers

var tagbar = new Tagbar({
    container: 'container-id',
    onAdd: function (tag) {
        console.log(tag);
    },
    onRemove: function (tag) {
      console.log(tag);
    },
    onSuggest: function (query, callback) {
      callback(['suggestion1', 'suggestion2', 'suggestion3']);
    }
  });

About

Tagbar component with an auto-suggester

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published