mithril.js README

The project's README from github.com/MithrilJS/mithril.js. As one markdown file: README.md.

Mithril.js

npm Version   License   npm Downloads   Build Status   Donate at OpenCollective   Zulip, join chat

What is Mithril.js?

A modern client-side JavaScript framework for building Single Page Applications. It's small (8.93 KB gzipped), fast and provides routing and XHR utilities out of the box.

Mithril.js is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍.

Mithril.js supports Firefox ESR, and the last two versions of Firefox, Edge, Safari, and Chrome. No polyfills required. 👌

Installation

CDN

<!-- Development: whichever you prefer -->
<script src="https://unpkg.com/mithril/mithril.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mithril/mithril.js"></script>

<!-- Production: whichever you prefer -->
<script src="https://unpkg.com/mithril/mithril.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mithril/mithril.min.js"></script>

npm

npm install mithril --save

The "Getting started" guide is a good place to start learning how to use Mithril.js.

TypeScript type definitions are available from DefinitelyTyped. They can be installed with:

$ npm install @types/mithril --save-dev

Documentation

Documentation lives on mithril.js.org.

You may be interested in the API Docs, a Simple Application, or perhaps some Examples.

Getting Help

Mithril.js has an active & welcoming community on Zulip, or feel free to ask questions on Stack Overflow using the mithril.js tag.

Contributing

There's a Contributing FAQ on the Mithril.js site that hopefully helps, but if not definitely hop into the Zulip stream and ask away!


Thanks for reading!

🎁

mithril.js (MithrilJS/mithril.js)

router
Searching Database…

What is this?Mithril.js is a modern client-side JavaScript framework for building Single Page Applications. It is small (8.93 KB gzipped), fast, and ships with routing and XHR utilities out of the box.
Does this run in my users' browsers, or do I need to deploy a server for it?It runs entirely client-side in the browser — there is no server component to deploy. Your JavaScript components are rendered through a virtual DOM on the page.
How do I add it to a project?Install it with npm (npm install mithril) or include the prebuilt bundle from a CDN, then follow the Getting started guide to build your first app.
Do I need Node tooling or other libraries to use it?No build step is required — you can drop the bundle in with a plain script tag, and the package has zero runtime dependencies. TypeScript users just add the DefinitelyTyped definitions.
Which browsers does it support?Firefox ESR plus the last two versions of Firefox, Edge, Safari, and Chrome — no polyfills required. Older browsers are out of scope.
Is anyone actually using this in production?Yes — companies like Vimeo and Nike and open source platforms like Lichess build with it, so it is proven on real single-page apps.
Do I need separate libraries for routing and AJAX?No. Routing and XHR utilities are built in, so you get a client-side router and HTTP requests without adding any extra dependencies.
How mature is Mithril.js?It has been around since March 2014 with about 14.5k GitHub stars, and it is used in production by Vimeo, Nike, and Lichess — a stable, well-tested choice.
Does it work with TypeScript?Yes — official type definitions are available from DefinitelyTyped and can be installed as a separate package alongside the framework.
Creator
MithrilJS
Size
10.4 MB
Stars
14.5K
Age
12y
Commits · 90 Days