WARNING: This documentation is for an old version of mithril! Please see the current docs for more accurate info.


A Javascript Framework for Building Brilliant Applications

Guide Download v0.2.5

Flattr Change Log

What is Mithril?

Mithril is a client-side MVC framework - a tool to organize code in a way that is easy to think about and to maintain.


  • Only 7.8 kB gzipped, no dependencies
  • Small API, small learning curve


  • Safe-by-default templates
  • Hierarchical MVC via components


  • Virtual DOM diffing and compilable templates
  • Intelligent auto-redrawing system

Sample code

var Page = {
	list: function() {
		return m.request({method: "GET", url: "pages.json"});

var Demo = {
	controller: function() {
		var pages = Page.list();
		return {
			pages: pages,
			rotate: function() {

	view: function(ctrl) {
		return m("div", [
			ctrl.pages().map(function(page) {
				return m("a", {href: page.url}, page.title);
			m("button", {onclick: ctrl.rotate}, "Rotate links")

m.mount(document.getElementById("example"), Demo);



To run the execution time tests below, click on their respective links, run the profiler from your desired browser's developer tools and measure the running time of a page refresh (Lower is better). Read more


Mithril 0.28ms
jQuery 13.11ms
Backbone 18.54ms
Angular 7.49ms
React 24.99ms


Mithril 9.44ms (uncompiled)
jQuery 40.27ms
Backbone 23.05ms
Angular 118.63ms
React 79.65ms


Mithril templates are safe by default, i.e. you can't unintentionally create security holes.

To run the tests for each framework, click on the respective links. If you see an alert box, ensuring security with that framework is more work for you.

Test Summary

Mithril (pass) ✓
jQuery (fail) ✗
Backbone (fail) ✗
Angular (pass) ✓
React (pass) ✓


Build a simple application. Learn the ropes

Read Guide


Docs and code samples for your reference

Read docs

Learn Mithril

Weekly articles on how to use Mithril to its full potential.

Read articles

Mailing List

Post questions and discuss Mithril related topics.

Go to mailing list

Social Media