Skip to content
DocsReferencePerformance & a11y

Performance & accessibility

Performance budget

TechniqueWhereEffect
translate3d (not top/left)VirtualCanvasGPU-composited; transform-only motion
State only on band crossinguseVirtualGridRefs hold scroll → no per-frame renders
Incremental masonry appenduseMasonryO(delta) appends vs O(n) recompute
Spatial bandsvirtual-windowO(1)/frame windowing; tiny index memory
Web Worker layoutuseMasonryWorkerOff main thread (slim payload across the boundary)
Pre-known dimensionsdatasetZero CLS
next/font + optimizePackageImportsappSmaller bundles, no layout-shifting fonts

Verify it live on the benchmark: FPS, frame time, visible tiles, DOM nodes, JS heap, layout time, scroll velocity, and long tasks under 1k–5k images.

Animation contract

Only transform and opacity are animated; layout properties never are. Every animation has a prefers-reduced-motion off-switch (plus a global safety-net in the design tokens).

InteractionPropertyDurationEasing
Image appearsopacity150msease-out
Tile moves (resize / swap)transform220msease-in-out
Hero revealopacity + transformstaggeredease-out

Accessibility

  • Meaningful alt text on every image; semantic landmarks and a skip link.
  • Arrow-key spatial navigation across tiles; reaching the overscan edge nudges the scroll to reveal more.
  • Focus-trapped lightbox with Esc and arrow support; visible focus rings throughout.
  • Full prefers-reduced-motion support; hover effects gated to hover-capable devices.

Verification

bun test          # 46 unit tests — algorithms, windowing, edges
bun run type-check
bun run lint
bun run build
npx react-doctor@latest   # React-correctness score (gated in CI)