Feature Library

Micro-interactions pack

0.03 CPU ms
A still of the Micro-interactions pack demo
Still
The live demo starts when it’s in view.Everything is live: hover, drag, click, type · move the pointer anywhere for the light trail

Magnetic buttons, springy flip cards, tilt with sheen, rolling and split-flap numbers, fling-to-dismiss, toasts, toasts that hang on a string and swing to…

What it costs a frame

0.03 ms
GPU
not used
CPU, median
0.03 ms
CPU, 95th pct
0.04 ms
Draw calls
0
Weight
Light

Measured 7 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 156, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured idle, the pointer away from the buttons: the per-frame cost is the magnetic springs checking their buttons. While the pointer pulls them, each moving button adds a style write. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring toolnot timed0.030.04
apple · Apple A19 Proin a browser tab · 16 November 2026not timed0.040.08
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed0.040.08

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages

What it’s for

  1. Buttons and calls to action
  2. Cards and dashboards
  3. Notifications
  4. Playful notifications on a string
  5. Counters and prices
  6. Forms that refuse nicely
  7. Onboarding
  8. A cursor that leaves light behind it on a dark page

Pitfalls, in brief

  1. flipCard turns the card in 3D on its own layer, where text is a little soft until the turn ends.
  2. Magnetic reads every element’s getBoundingClientRect each frame: keep the selector to a handful of buttons, or step it only while the pointer is near.
  3. Magnetic writes a CSS translate (not transform), so a style’s own transform still applies; tilt and fling do write transform: do not combine them on one element.
  4. Flip cards need preserve-3d all the way down: an overflow: hidden or filter on .fx-inner flattens them and the back shows through.
  5. Split-flap steps need the digits’ strip height to match the line height (1em by default); a bigger font needs .fx-digit and .fx-strip i sized to match.
7 more in brief
  1. prefers-reduced-motion turns off the magnetic pull, the strip transitions and tilt: keep anything that carries meaning readable without motion.
  2. The trail’s canvas fills its layer, so give it a positioned layer that does not scroll (a stage around a scrolling area), or leave it on the page, where it is fixed to the viewport.
  3. The trail is decoration: it never says anything a person needs, so it is off under reduced motion and for touch, and it is hidden from screen readers.
  4. The trail’s colour is read once (and on refresh()): call refresh() after a theme change, or it keeps the old colour.
  5. Hanging tags pivot where the strings end: the container needs fx-tags (or the same gap and top padding as --fx-tag-gap and --fx-tag-top), or a tag swings round a point beside its string.
  6. A hanging tag writes its own transform while it swings: flingable on it works (the swing waits while it is dragged), but tilt or magnetic on the same tag fight it.
  7. A tag’s string is drawn outside its box (bottom: 100%): no overflow: hidden on the tag itself.
12 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Fully custom code.

domcssspringsanimationweb animationscanvas 2dpointer trailtoastsaccessibilityno dependencies

Near it in the frame