Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Simple and elegant component-based UI library
Riot.js is a small, open-source, component-based JavaScript UI library that brings custom components to all modern browsers using a concise HTML-like tag syntax.
Riot.js is a client-side UI library maintained by Gianluca Guarini and contributors, released under the MIT license. It takes custom component definitions written as HTML-like "tags" — each with a script block exporting the component's state and lifecycle methods — and mounts them into the DOM, producing dynamic, updating views. It runs in all modern browsers, and its modular ecosystem adds server-side rendering, hydration, routing, and lazy loading for Node.js environments.
@riotjs/cli for local compilation, @riotjs/ssr for server rendering, @riotjs/hydrate for SPAs, @riotjs/route for routing, and @riotjs/lazy for lazy component loading.onBeforeMount, onMounted, and onUnmounted (among others) so you control component setup and teardown.@riotjs/ssr to render tags to markup in Node, then hydrate them on the client.riot.mount.@riotjs/route for isomorphic routing and @riotjs/hydrate to add interactivity to server-rendered pages.@riotjs/ssr to render tags to plain markup in Node, ideal for SEO or static generation.You define a component as an HTML-like tag with a script block that exports the component's state, methods, and lifecycle hooks. Then you call riot.mount with a selector and optional props to render it. Updates happen by calling this.update with new state, and the pre-compiled expression bindings update only the changed DOM parts. Tags nest like standard HTML elements, so you compose views by placing tags inside other tags.
Yes, Riot.js is released under the MIT license, so it's free to use commercially and personally without restrictions.
No, Riot uses pre-compiled expression bindings that update the DOM directly, which avoids virtual DOM memory overhead and can be more performant for frequent updates.
Yes, Riot is designed to play well with any frontend framework. It adds no proprietary event system or special DOM attributes, so you can embed Riot components inside React, Vue, or plain HTML pages.
Use the official @riotjs/ssr package to render tags to markup in Node.js, and @riotjs/hydrate to make them interactive on the client for SPA-like experiences.
