call(back)

UI Questions Cheatsheet

The checklist a UI build is graded against — instances, state, HTML and forms, network, keyboard, edge cases, strings — as a question of its own, then one problem per section in the order you would run them.

1

What Do You Check Before Calling a UI Component Done?

Frontend · The review you run on your own build: instances, state, HTML, forms, network, keyboard, edge cases, strings.

mediumSign in to star problems
2

Tabs: initTabs(node)

Frontend · A tab UI packaged as an initializer — two independent instances from one function.

mediumSign in to star problems
3

Nested Checkboxes

Frontend · Store only the leaves; every parent's checked and indeterminate state is derived from the leaves beneath it.

mediumSign in to star problems
4

Multi-Step Form With a Shared Store

Frontend · Three steps, one reducer: data survives Back, each step validates before Next, and submitting locks the form.

mediumSign in to star problems
5

Sign-Up Form

Frontend · Native attributes carry the rules, one message per field is linked by aria-describedby, and the button locks while the request is out.

mediumSign in to star problems
6

Star Rating in a Form

Frontend · Real radio inputs behind the stars: the form submits itself, the keyboard works, N instances are N names.

mediumSign in to star problems
7

A Tooltip Library From data Attributes

Frontend · One tooltip node, delegated listeners, keyboard focus and Escape — in plain DOM, not a component.

mediumSign in to star problems
8

Image Carousel With One Image Element

Frontend · Previous, next and page buttons that wrap around, any aspect ratio fitted to a fixed frame, and a single <img>.

easySign in to star problems
9

Like Button

Frontend · Three states the server confirms and one it hasn't: pending blocks a second click, failure shows its message, the label never changes.

mediumSign in to star problems
10

Typeahead with Keyboard Navigation

Frontend · Debounce the query, abort the stale request, cache by query, wrap the arrow keys, wire the combobox.

hardSign in to star problems
11

Debounce

Frontend · Closures and timers, the frontend screen classic.

easySign in to star problems
12

Data Table I

Frontend · Three pieces of state — page, page size, sort — and rows derived from them in render.

mediumSign in to star problems
13

Windowed List

Frontend · One state value, scrollTop; a spacer as tall as the whole list; and only the rows under the viewport in the DOM, keyed by id.

mediumSign in to star problems
14

Load CSS on Demand

Frontend · A promise around a <link>, memoized by href, that forgets failures so a retry can work.

mediumSign in to star problems
15

How Do You Secure a Site?

Frontend · HTTPS, CSP, cookie flags and escaping — each named with the attack it stops.

mediumSign in to star problems