Use
HTML
<rg-alerts></rg-alerts>
JavaScript
var tags = riot.mount('rg-alerts', {
alerts: [{
type: 'primary',
text: 'Look! Something you should know about.'
}, {
type: 'secondary',
text: 'Warning! You can\'t remove this alert.',
dismissable: false
}, {
type: 'success',
text: 'Success! Well done. This alert will disappear in 10 seconds',
timeout: 10000
}, {
type: 'error',
text: 'Error! Something bad happened. ',
dismissable: true
}]
});
tags[0].on('select', function (alert) { ... })
.on('dismiss', function (alert) { ... })