Skip to content

Motion

A small motion system: three durations, three curves, the noodle’s own entrance for anything you add, staggered lists, press and lift feedback, drawn lines, counted numbers and cross-faded changes. All of it stops under reduced motion.

CSS + mian.js JSON Markdown Registry item

Entrance and stagger

Press the button: the list is re-inserted and enters in this noodle’s own style.

  • Invoice sent
  • Reminder scheduled
  • Payment received
  • Receipt emailed

Press, lift and count

Installation

Everything ships in one stylesheet and one small script. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">
<script src="https://mian.ro/dist/mian.js" defer></script>

Prefer to own the files? /r/motion.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
--mn-dur-fast · --mn-dur · --mn-dur-slow120, 200 and 360 ms: feedback, state change, layout change.
--mn-ease-out · --mn-ease-in-out · --mn-ease-springArriving, moving across the screen, and a soft overshoot for playful noodles.
mn-enterPlays the current noodle’s entrance once, when the element is added.
mn-staggerOn a container: its first eight children enter 45 ms apart (--mn-stagger-step).
mn-pressShrinks to 97% while pressed.
mn-liftRises 2px with a shadow on hover, for whole-card links.
mn-drawOn an SVG path with pathLength="1": draws the line in.
data-mn-countCounts up to the element’s own number once, when first seen.
Mian.transition(fn)Runs a DOM change inside a view transition, so it cross-fades. Mian.setNoodle and Mian.setMode use it.

Accessibility

  • Everything here is disabled by prefers-reduced-motion: reduce; nothing depends on an animation finishing.
  • Animate to explain a change (something arrived, moved, was pressed), not to decorate. Do not fade sections in as the reader scrolls.
  • Keep motion under 400 ms and never loop it near text.
  • Counted numbers keep their final value in the DOM, so assistive technology never reads a partial count.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page