Interaction Lab

Features

  • A bead of liquid metal from 60 particles with short-range cohesion
  • Leans toward a nearby pointer
  • Press to grab part of it; drag to stretch and tear it into droplets
  • Droplets roll back to the middle and merge again
  • Halftone metaball shading lit from the top left; grabbed metal turns blue

API reference

<Mercury /> from components/aiforui/mercury.tsx

PropTypeDefaultDescription
particlesnumber60Particles in the bead. Changing it rebuilds the bead.
cohesionnumber1800Cohesion σ: how hard neighbours pull together.
grabnumber46Radius in px that a press grabs.

Keyboard interactions

TabFocuses the exhibit. Blue corner brackets show it has focus.
← → ↑ ↓Moves the blue probe 12px. It stands in for the pointer.
Shift + arrowsMoves the probe 48px.
Space (hold)Grabs the metal under the probe; arrows drag it and letting go flings it.
EnterTaps at the probe.
EscapeLets go and hides the probe.

Accessibility

  • The tile is a focusable role="group" with aria-roledescription "interactive demo" and a label that says what it shows and how to drive it.
  • The canvas and the SVG overlay are aria-hidden. A polite live region reads the live stats about 0.7s after keyboard input settles.
  • With prefers-reduced-motion, frames only run while the pointer is inside or for about 3 seconds after input, so the bead stays still unless you are touching it.
  • The animation loop pauses while the tile is offscreen or the tab is hidden.
  • Focus is shown with corner brackets on :focus-visible only, so mouse clicks do not leave a ring.

Sound & haptics

Silent. It plays no sound and triggers no haptics.

Files

Written from scratch for sher.md and inspired by the Interaction Lab on aiforui.dev. It is an original build: it contains none of aiforui.dev's code, styles, assets or sounds, and its text is our own.