Three states
Every view that loads data designs its loading, empty and error states, not just its content.
Rules
Every view that loads data renders exactly one of four states: loading, empty, error, or its content. The first three are designed, never left to chance: a surface that shows nothing while it waits, or shows nothing when it failed, has left the person to guess which of four things is true.
| State | What it shows | Never |
|---|---|---|
| Loading | A skeleton of the loaded shape (Skeleton / Loading below) | A blank area, or a lone spinner over a full screen |
| Empty | An icon, a descriptive title and the action that fills it (Empty and Error States) | A blank panel, or "No data" with no next step |
| Error | An inline message with a retry, at the smallest part that failed | A full-screen block for a recoverable error, or silence |
| Content | The data | none |
- Empty and error are different facts. "There is nothing yet" and "we could not load it" never share a message or a look; a failed load that renders as empty tells the person their data is gone.
- The failure stays where it happened. A widget, card or row that fails shows its own error state; the page around it keeps working.
- Loading appears fast and holds its shape. Within 100ms, at the loaded size, so nothing jumps when the content arrives.
- Each platform handles all three on every data view: web
useQueryrendersisLoading, empty andisErrorexplicitly; iOS and Android view models expose the same four cases. - A list of the viewer's own things picks its state through one rule,
decideViewerListState(@yroun/util, L1): items, signed out (hidden), error, loading (a session still settling counts), empty. - The compact empty state is one quiet line for a section inside a busy surface (a sidebar list, a panel): a 16pt icon and the title with its hint in secondary text, no button. The section heading already names the list.
Skeleton / Loading
Loading never blinks, and the screen before the answer has the shape of the screen after it. Every async section holds its final space from the first frame, with the content blank and a light sweeping left to right; when the answer arrives, the content takes exactly that space and nothing moves.
- Reserve the loaded shape. The skeleton is the loaded layout with its text and media blank: the same sections, the same inner blocks at their final size (fixed height, or the aspect ratio the media will have), the same surface and background. Target: no layout shift from that section (CLS 0).
- Show the space at once; move only after 150ms. The blocks render on the first frame. The sweep starts after 150ms, so a fast response never flashes a moving skeleton and nothing jumps either way. "Immediately" in the Speed rules means the reserved space, not the motion.
- Never back to the skeleton. A refetch keeps the data on screen (TanStack
placeholderData: keepPreviousData, iOS/Android keep the last state) with at most a quiet progress hint; cached data renders straight away. A skeleton is for the first load only. A frame that stays on screen while its data changes (a calendar stepping between months) keeps its bones. The wait is a 2px bar on its edge (loading-bar), after 150ms, still under reduced motion. Days it cannot answer for take a placeholder only after 300ms (<Skeleton late>), so a quick answer shows just the bar; they never read as empty. It stays operable, so it takes noaria-busy; a wait past a second is said in its live region. Hold across a move in time only, never across another hub or filter (isSameSubjectAcrossTime). - One look on every platform. A base block on the surface tone, a sheen sweeping left to right over about 1.6s, still under reduced motion. Decorative: the section says "loading" once (
aria-busy), never per block. - Never a blank area,
nullwhile loading, a lone spinner for a section, or the pulse (animate-pulse). The pulse animates the placeholder node's own opacity, which gives it a compositor layer; when that node becomes the loaded content after first paint, Chrome reports a layout shift from (0,0). The sweep animates only a pseudo-element, so the node never moves.
| Platform | Skeleton |
|---|---|
| Web | <Skeleton shape="line | block | circle"> from @yroun/ui (utility skeleton-shimmer), sized with the loaded element's own classes |
| iOS | skeletonBase blocks at the loaded size under .shimmer() (Core ShimmerModifier): the sweep, the 150ms delay, still under Reduce Motion, and one "Loading" for VoiceOver |
| Android | Skeleton(shape = Line | Block | Circle, corner) / Modifier.skeleton() from core components: the same sweep and 150ms delay, still with animations removed; the section takes Modifier.loadingSection() |
Late content is no exception. An ad, a recommendation, anything a second request fills, holds its frame between page sections from the first frame to the last, whatever kind of item arrives; a slot that may resolve to nothing still keeps its frame or is not placed between sections. The Play home's ad card held a 4px stub and pushed every shelf down by 77px.
Live specimens
Reading list
Reading list
Your reading list is empty
Reading list
Could not load your reading list.
Reading list
- One focal point per screen
- Why motion explains change