viewof buttonSize = Inputs.range([24, 72], {
value: 44,
step: 2,
label: "Button size (CSS px):"
})
viewof buttonDistance = Inputs.range([50, 400], {
value: 200,
step: 10,
label: "Distance to button (CSS px):"
})
fittsTime = {
const a = 50; // Intercept (ms)
const b = 150; // Slope (ms)
const D = buttonDistance;
const W = buttonSize;
return a + b * Math.log2((D / W) + 1);
}
md`**Fitts's Law Calculator**
**Current Configuration:**
- Button size: **${buttonSize} × ${buttonSize} CSS px**
- Distance: **${buttonDistance} CSS px**
- Targeting time: **${fittsTime.toFixed(0)} ms**
**WCAG 2.5.5 AAA target-size example (subject to exceptions):** ${buttonSize >= 44 ? '✓ Meets 44 CSS px size' : 'Below 44 CSS px size'}
*Larger buttons and shorter distances make targeting faster and easier for users with motor impairments.*`Fitts’s Law Calculator
Fitts’s Law Calculator
animation
accessibility
ux-design
Try Open the calculator and make the button 48 CSS px wide, then press Calculate.
Observe After pressing Calculate, read the targeting time and the 44 CSS px size check.
Explain Explain why a larger target, such as 48 CSS px instead of 32, lowers targeting time after you press Calculate.
Technical boundaries. Targeting time uses fixed intercept and slope values of 50 ms and 150 ms. The target-size example is subject to exceptions.
TipDeep dive: Putting Numbers to It
WCAG contrast ratio calculation: For text to be WCAG AA compliant, contrast ratio must be (normal text) or (large text ≥18pt). Light gray #AAAAAA on white #FFFFFF has relative luminance , , giving — fails WCAG AA (needs 4.5). Dark gray #595959 has , giving — passes WCAG AA.
Touch target accessibility: WCAG 2.5.5 (Level AAA) specifies at least 44 × 44 CSS pixels for pointer targets, subject to exceptions. A 32 CSS px square has area ; a 44 CSS px square has area , 89% larger. In an illustrative independent two-axis model with independent horizontal and vertical normal touch errors of , the hit probability for a square target of half-width is : 32 px gives 79.3% and 44 px gives 94.5%, a 19.2% relative improvement.
Fitts’s Law for motor accessibility: Time to reach a target is where = distance, = target width, , . For a button 200 CSS px away, 32 CSS px wide: . For 48 CSS px wide: — 15% faster targeting, critical for users with motor impairments.
Multi-device state sync latency: For a smart home with devices (phone, tablet, watch, hub, voice assistant), achieving consistent state across all devices with (perception threshold) requires real-time pub-sub architecture. Star topology (all devices → hub → cloud → broadcast) has 2-hop latency . Peer-to-peer mesh has simultaneous broadcasts at (local network) — 6× faster than cloud round-trip.
Screen reader semantic markup efficiency: In this illustrative navigation model, two 1.5-second jumps through properly named landmarks take 3 seconds versus an assumed 15-second linear scan, an 80% modeled reduction. Use labelled <nav> landmarks for navigation and native <button> elements for actionable controls; do not rely on role="button" alone.