Tags

View code

Use

HTML

<rg-tags></rg-tags>

JavaScript

var tags = riot.mount('rg-tags', {
  tags: {
    placeholder: 'Choose a country',
    filter: 'text', // <-- this enables filtering on the 'text' property
    options: [{
      text: 'Canada'
    }, {
      text: 'China'
    }, {
      text: 'United States'
    }, {
      text: 'United Kingdom'
    }],
    tags: [{
      text: 'Japan'
    }]
  }
})

tags[0].on('open', function () { ... })
       .on('close', function () { ... })
       .on('select', function (item) { ... })