Blog
Writing about Micra
Migration guides, the anti-patterns worth avoiding, and how the library works under the hood.
October 29, 2026
Accessible components in Micra: focus, keyboard, and aria from one state
A modal with a focus trap, tabs with a roving tabindex, and a switch — where the accessibility lives in each, how many lines it takes, and what Micra 2.9's .window modifier and tick() changed in them.
Read →October 19, 2026
Micra 2.9: listeners outside the element, and waiting for the render
Micra 2.9.0 adds the .window and .outside event modifiers and this.tick(). Why these three, found by counting what the Pro components had to write by hand, and the one case jsdom couldn't catch.
Read →October 14, 2026
Micra on Rails: small components in a Rails admin
What actually runs on Micra in a Rails admin with Turbo: mounting across Turbo navigations, a form that autosaves drafts to localStorage, a character counter, and tag autocomplete — real code, with the parts that didn't come out perfect.
Read →October 12, 2026
Optimistic updates: a like button that responds instantly and can roll back
A like button on a server-rendered page that updates before the request returns, adopts the server's count on success, and restores a snapshot on failure — about thirty lines of Micra.
Read →October 9, 2026
Micra 2.8: a kilobyte lighter, and three bugs found on the way
What changed in Micra 2.8.0 — the core went from 8.0 to 7.0 KB gzip with no API change, three long-standing bugs surfaced during the audit, and pair lists learned quoted names for Tailwind classes.
Read →October 9, 2026
Micra + Tailwind: when state drives the classes
Tailwind decides how an element looks, state decides when. A component method turns state into the full class string — plus transitions that survive show/hide, dark mode on the root, and why Tailwind can't see class names built at runtime.
Read →September 9, 2026
Astro islands for light reactivity: zero JavaScript where none is needed
How micrajs.dev uses the @micrajs/astro integration: each interactive spot on a page is its own island, loads its own small chunk on its own trigger, and a page with nothing to hydrate ships no Micra at all.
Read →September 8, 2026
From jQuery to Micra: rewriting a typical page
The same page — a mobile menu, tabs, and a request form — written first in jQuery, then in Micra, to show what moves out of the DOM once state lives in one object.
Read →September 7, 2026
The landing page is almost done — now the small stuff. What do you build it with?
The bits left after the mockup — burger menu, FAQ, pricing toggle, reviews carousel, contact form, cookie banner — all reduce to five kinds of state, with working Micra code for each.
Read →June 26, 2026
Reactivity instead of updating the DOM by hand: the same tasks in plain JS and in Micra
The same UI tasks written twice — in plain JavaScript and in Micra — to find the point where tending the DOM by hand stops paying off.
Read →June 24, 2026
Micra + htmx: HTML over the wire, local state alongside
How htmx and Micra split the work — htmx delivers server-rendered HTML, Micra holds the client-only state on top — and the three-line bridge that ties them together.
Read →June 22, 2026
Why I built Micra
Why I built Micra — a small library for adding reactivity to server-rendered HTML, and what it deliberately leaves out
Read →June 15, 2026
Under the hood: how a reactive framework fits in 7 KB
A long read on Micra's internals — the shallow proxy, the microtask scheduler, the CSP-safe expression parser, and the keyed list diff
Read →June 14, 2026
Porting attribute-driven code to Micra: a syntax map and six steps
Moving code from another attribute-driven library to Micra — a substitution table, six conversion steps on real fragments, and the places where the mechanics actually differ.
Read →May 26, 2026
Common mistakes in Micra — and how to fix them
Eight mistakes that come from using Micra like jQuery or React, the two mechanisms they all follow from, and the shorter rewrite for each.
Read →