react-ui-patterns

Implements React UI patterns for loading states, error handling, and async data fetching.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/involvex/dev --skill react-ui-patterns-involvex
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-ui-patterns
Source: https://github.com/involvex/dev/tree/main/.claude/skills/react-ui-patterns
Command: npx skills add https://github.com/involvex/dev --skill react-ui-patterns-involvex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React components often flash loading spinners over cached data, silently swallow errors, or allow duplicate form submissions, producing confusing user experiences. This Skill provides concrete patterns and checklists for handling loading, error, empty, and button states correctly. ## Core Features & Use Cases - Loading State Patterns: Decision trees and rules for showing spinners or skeletons only when no data exists, avoiding UI flashes on refetch. - Error Handling Hierarchy: Guidance on inline errors, toasts, banners, and full error screens, with a reusable ErrorState component pattern. - Button and Form Submission Patterns: Disable triggers during async operations and surface mutation results via toast feedback. - Use Case: When building a data-driven list page with React Router and a mutation-based form, apply these patterns so users always see errors, never lose cached content to spinners, and cannot double-submit. ## Quick Start Apply the react-ui-patterns skill to review my component's loading, error, and empty states and fix any anti-patterns.

Frequently Asked Questions about react-ui-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle loading states in React without flashing spinners?▼

Show a loading indicator only when loading is true and no data exists yet. Checking loading alone causes spinner flashes on refetch even when cached data is available, so always gate the spinner on the absence of data.

When should I use skeleton screens vs spinners in React?▼

Use skeletons when the content shape is known, such as list or card layouts and initial page loads. Use spinners for unknown content shapes, modal actions, button submissions, and inline operations.

How do I prevent duplicate form submissions in React?▼

Disable the submit button while the mutation is in flight and show a loading indicator on it. Relying only on changing the button label still lets users trigger multiple submissions.

What is the right way to show mutation errors in React?▼

Always surface errors through an onError handler that displays a toast, banner, or inline message. Logging errors only to the console leaves users unaware that an operation failed.

Why does my React list show a blank screen when empty?▼

The component lacks an explicit empty state for the collection. Render a dedicated empty state component with an icon, title, description, and optionally an action such as creating the first item.