← Blog

Canvas vs DOM & Interactive UI

Canvas vs DOM tradeoffs, CSS interactions, custom physics, and portfolio design

interactive UI implementationCanvas vs DOMCSS interactionsCanvas accessibilityweb rendering performance

Comparison guides for this topic

Comparison guides repeatedly referenced across this topic, collected as the next practical step.

Browse more Picks →

6 articles

#125 min

Canvas vs DOM — Decision Criteria from 203 Components with Real Benchmark Data

The decision criteria used to assign 203 interactive components between Canvas API and DOM, explained with real examples and measured performance data.

#229 min

Top 10 Bugs from 203 Canvas/DOM Components — Patterns Revealed by Real Data

Bugs encountered during the development of 203 interactive components, tallied from git history. The most frequent patterns and their fixes presented in a Top 10 format.

#38 min

Interactive UI with Pure CSS — Practical Use of transform, transition, and Custom Properties

CSS techniques using transform, transition, and custom properties demonstrated through DOM+CSS-based interactive UI components like FidgetSpinner, InfiniteKnob, and ToggleSwitch.

#425 min

The Limits of a 180-Line Custom Physics Engine — Why I Dropped Matter.js and What I Couldn't Cover

Built a custom 2D physics engine in 166 lines of physics.ts, reducing Matter.js's 300KB to 4KB. The trade-offs of focusing on gravity, collision, and bounce while giving up constraints, friction, and stacking.

#59 min

Interaction Patterns That Improve CVR: 6 Ways to Extend Attention

A practical map of six interaction patterns from the sakimyto.com CVR interaction directory: invite touch, build anticipation, start chain reactions, make controls malleable, vary rewards, and remove endpoints.

#65 min

Building a Custom Physics Engine for the Browser from Scratch

How I built a lightweight 180-line physics engine in TypeScript instead of using Matter.js for my portfolio site. Reduced bundle size from 300KB to 4KB while maintaining 60fps.