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',
      style: 'info'
    }, {
      text: 'Scotland',
      style: 'brand'
    }, {
      text: 'Ireland',
      style: 'warning'
    }, {
      text: 'Wales',
      style: 'success'
    }],
    tags: [{
      text: 'United States',
          style: 'error'
    }]
  }
})

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