Live demo

Change the code of tag definition (left side) freely, then you’ll see the result.

How to use this tag?

You can mount this tag on HTML easily. Save the source above as sample.tag, and also create index.html:

<html>
  <head>
    <title>Hello Riot.</title>
  </head>
  <body>
    <!-- place the custom tag anywhere inside the body -->
    <sample></sample>
    <!-- include the tag -->
    <script type="riot/tag" src="sample.tag"></script>
    <!-- include riot.js -->
    <script src="https://cdn.jsdelivr.net/npm/riot@3.13/riot+compiler.min.js"></script>
    <!-- mount the tag -->
    <script>riot.mount('sample')</script>
  </body>
</html>

That’s it!

Further reading