
Mithril
A small JavaScript framework for building single page web apps, with routing and XHR built in.MithrilJS/mithril.js
- Stars
- 14.5k
- Forks
- 922
- Licence
- MIT
- Language
- JavaScript
- Last update
- 3 months ago
- Type
- Library
What it is
Mithril.js is a client-side JavaScript framework for building single page applications, where the page updates in the browser without full reloads. According to its README, it is small (about 8.93 KB gzipped) and includes routing and XHR (network request) utilities without extra packages. It is installed via npm or loaded from a CDN.
- Build a single page web application with client-side routing
- Make XHR requests to load data into the page
- Add Mithril via a script tag for a quick prototype without a build step
Great for
- Developers who want a small framework with routing and HTTP utilities included
- Teams building single page apps who prefer a lightweight alternative to larger frameworks
- Projects targeting modern browsers, since the README says no polyfills are required
Not ideal for
- People who need server-side rendering or a backend framework, since the README only describes client-side use
- Non-programmers looking for a no-code tool, since it requires writing JavaScript
- Projects needing support for old browsers beyond Firefox ESR and the last two versions of major browsers, per the README
How to get it
- 1
Install with a package manager
Install via npm
npm install mithril --saveInstall TypeScript type definitions (optional)
npm install @types/mithril --save-dev - 2
Run it
- Install the package with npm or add one of the CDN script tags to an HTML page
- Read the Getting started guide at mithril.js.org
- Work through the Simple Application example in the docs
- Explore the API docs for routing and XHR
- 3
Get the most out of it
- Follow the Getting started guide on mithril.js.org for a structured introduction
- Use the TypeScript type definitions from DefinitelyTyped if you work in TypeScript
- Browse the Examples page on the docs site for working code
- Ask questions on the Zulip chat or tag Stack Overflow questions with mithril.js
Downloads
Strengths
- Small size, about 8.93 KB gzipped according to the README
- Routing and XHR utilities are included out of the box
- MIT licensed with an active community on Zulip and Stack Overflow
Trade-offs
- The README does not detail the feature set beyond routing and XHR, so the scope is unclear from this source alone
- Documentation is hosted on an external site, and the README is brief
- Browser support is limited to recent versions as listed in the README
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| mithril.js (this) | 14.5k | Library | intermediate | 3 months ago | Developers who want a small framework with routing and HTTP utilities included |
| react | 252k | Library | intermediate | 6 days ago | Developers building interactive web interfaces with JavaScript |
| vue | 212k | Library | intermediate | 2.1 years ago | Maintaining an existing Vue 2 application that cannot yet be upgraded |
| svelte | 88.5k | Library | intermediate | 4 days ago | Developers who want to build interactive websites with less boilerplate |
| preact | 39k | Library | intermediate | 4 days ago | Web developers who already know React and want a lighter library |
| hyperapp | 19.2k | Library | beginner | 1.6 years ago | Developers who want a very small framework for simple to medium browser apps |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.