Accordion

View code
New in v3.6.0! The accordion is still in beta, but you can see it working here

Use





  • You can now write the content of the accordion in markdown!
  • Event on open or close, a notify event is triggered

HTML

<rg-accordion></rg-accordion>

JavaScript


var tags = riot.mount('rg-accordion', {
             accordion: {
               panels: [
                      {
                      title: 'Heading 1',
                      content: '# Content 1 - _testing italics_'
                      },
                      {
                      title: 'Heading 2',
                      content: '## Content 2 some **bold proof**'
                      },
                      {
                      title: 'Heading 3',
                      content: '### Content 3'
                      },
                    ]
             }

        });

       tags[0].on('notify', function(e) {
           console.log("notify: ", e)
        })
	
Hint! Check the browser console for notifications.