Riot.js builds interfaces with compiled custom tags, concise HTML-like syntax, and a small runtime. It targets modern browsers without polyfills for custom elements.
Overview
Riot.js is a client-side UI library organized around custom tags that combine HTML templates with JavaScript logic. Tags compile to JavaScript before execution and compose into nested views using familiar HTML structure and attributes instead of a proprietary component format.
The runtime emphasizes direct expression bindings, one-way data flow from parent to child, lifecycle hooks, and precompiled cached templates to limit DOM churn compared with virtual-DOM-centric libraries. It stays close to web standards: no proprietary event bus, module syntax for components, and freely manipulable rendered DOM.
Tooling is split into optional packages for CLI compilation, server-side rendering, hydration, routing, lazy loading, hot reload, parsing, and DOM bindings. Build pipelines can integrate webpack, Rollup, Parcel, Browserify, or @riotjs/cli, and tags can be authored with preprocessors such as TypeScript.
Published size figures on the project site place the core library in the low kilobyte gzip range relative to larger frameworks, while still covering modular views, performance with many nodes, and an ecosystem described as pick-what-you-need modules.
Key features
- Custom tag components
- Compiled templates to JavaScript
- One-way parent-to-child updates
- Lifecycle control methods
- Modular @riotjs packages
- CLI and bundler integrations
- Server-side rendering support
- No virtual DOM requirement
Use cases
- Lightweight single-page interfaces
- Embedded widgets with custom tags
- Isomorphic tag rendering
- Projects avoiding heavy UI runtimes