Skip to main content

Search rules

Search all UI Guides rules by name, category, or source

performanceVercel

Keep Keystroke Cost Low

SHOULD

SHOULD: Prefer uncontrolled inputs; make controlled loops cheap (keystroke cost)

Prefer uncontrolled inputs, and keep every controlled input cheap per keystroke

Bad

Good

Why it matters

A controlled input turns every keypress into a React render of its owning component and everything below it. If that subtree is expensive — a chart, an editor, a formatted list — the input visibly lags behind the user's fingers. Uncontrolled inputs (defaultValue + a ref) let the DOM own the value, so typing costs zero renders. When you do need controlled state, keep the subtree it feeds trivial: hoist the state down to the input, memoize expensive children, or defer the derived work with useDeferredValue.

Built by Gleb Stroganov, design engineer at Evil Martians.

The rules come from other people's skills and guidelines — Vercel, Rauno Freiberg, @Ibelick, impeccable, Emil Kowalski, Tailwind, RAMS — each one credited on the Sources page. The work here is extraction and wiring: every rule is pulled into one corpus, given a good and a bad example you can operate, a MUST/SHOULD/NEVER rule an agent can paste, and a link back to where it came from.