Toasts

View code

Use


HTML


	<rg-toasts></rg-toasts>
	

JavaScript


var tags = riot.mount('rg-toasts', {
  toasts: {
    position: 'bottomright|bottomleft|topleft|topright',
    toasts: [{
      style: 'error',
      text: 'Made you look!',
      sticky: true // Turn off timeout
    }, {
      style: 'warning',
      text: 'Careful now...'
    }, {
      style: 'success',
      text: 'You did it!'
    }, {
      style: 'info',
      text: 'Oops!',
      timeout: 4000 // Default to 6000 if not set
    }]
  }
})

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