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: 'England'
    }, {
      text: 'Scotland'
    }, {
      text: 'Ireland'
    }, {
      text: 'Wales'
    }],
    tags: [{
      text: 'United States'
    }]
  }
})

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