ui-states
Installation
SKILL.md
UI States
Produces a complete, implemented set of states for a screen or component, so users never face a blank area, an endless spinner, or a dead-end error.
When to use
- "Add loading and empty states to this page."
- "What should happen when the API fails or the user is offline?"
- Planning a new feature: map states before high-fidelity design.
- A mockup or codebase shows only the ideal, data-filled state.
- Reviewing error messages, toasts, and recovery paths.
Workflow
- List the screen's data sources and user actions. For each, enumerate loading, empty (first-use, user-cleared, no-results), success, error, partial, stale, offline, and permission-denied.
- Mark which states are reachable and explicitly drop the rest.
- For each reachable state, define the visual, the copy (headline, one-line explanation, action), and which controls stay available. Use ux-writing for copy.
- Pick the loading treatment by expected duration and whether the final layout is known.
- Place errors by scope: a field or widget gets an inline error, a whole view gets a page state, a background action gets a toast or banner.
- Model the state in code as one explicit status value, not a set of independent booleans.
- Make every state previewable (story, fixture, or dev toggle) and review them side by side.