{"success":true,"name":"design-empty-loading-and-error-states-before-the-happy-path","description":"Building a screen that shows fetched or user-created data.","category":"ai-brimind","path":"ai-brimind/design-empty-loading-and-error-states-before-the-happy-path/SKILL.md","file":"SKILL.md","content":"---\nname: design-empty-loading-and-error-states-before-the-happy-path\ndescription: \"Building a screen that shows fetched or user-created data.\"\n---\n\n# Design Empty, Loading, and Error States Before the Happy Path\n\n## When to use\nA view depends on data that can be absent, still loading, or failed, and the current design only shows the version where everything worked.\n\n## Example request\nNew user opens their dashboard → blank white area because there's no data yet; nothing tells them what to do — empty state with a call to action. Slow network → screen shows nothing for 4 seconds, user thinks it's broken — loading indicator or skeleton. Fetch fails silently → the list just never appears — visible error state with retry.\n\n## Instructions\nAct like a designer who knows the happy path is only one of four screens. For every data-driven view, explicitly design all states BEFORE coding the success case: (1) LOADING — what does the user see while waiting (spinner, skeleton, disabled controls)? (2) EMPTY — data loaded but there is none: show a friendly explanation and the action that creates the first item, never a blank area; (3) ERROR — the fetch failed: show a human message and a retry path; (4) SUCCESS — the normal view. In code, make the state explicit (e.g. a status variable: 'loading' | 'empty' | 'error' | 'ready') instead of inferring it from whether an array happens to be undefined — that inference is where blank-screen bugs live. Before finishing, force each state to appear (throttle network, return empty data, kill the endpoint) and look at it. Only proceed when all four states render something intentional, and name what each state tells the user to do next.\n\n## Metadata\n- role: UX lead\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1011\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}