Interaction Lab

Features

  • Sixteen lines of 9px print that is scrambled until magnified
  • Fisheye lens: the middle magnifies, the rim compresses
  • Press to zoom from ×2.4 to ×3.4
  • Rim characters flicker blue where the lens is squeezing them
  • Line:column under the lens and a count of legible characters

API reference

<Loupe /> from components/aiforui/loupe.tsx

PropTypeDefaultDescription
radiusnumber118Lens radius in px.
magnificationnumber2.4Zoom at rest.
pressMagnificationnumber3.4Zoom while pressed.

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)Zooms to the press magnification while held.
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 lens does not drift on its own.
  • The small print is original copy and is also readable in text.ts.
  • 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.