Interaction Lab

Features

  • 4,000 dust grains orbiting a central mass and two moons
  • The pointer is a softened third mass that pulls dust into spiral arms
  • Hold to capture grains into a tight knot; release flings them on your velocity
  • Density splatted to a 4px halftone grid and blurred into continuous tone
  • Live captured count, pointer mass and revolutions in the footer

API reference

<Accretion /> from components/aiforui/accretion.tsx

PropTypeDefaultDescription
grainsnumber4000Number of dust grains. Changing it rebuilds the disc.
pullnumber1Strength of the pointer's gravity, as a multiple of the default.
softeningnumber18Softening length ε in px. Larger is gentler near the pointer.

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)Holds the pointer mass down: grains near the probe are captured until you let go.
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 disc stops orbiting when you stop interacting.
  • 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.