react-ui-patterns

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

1|Updated Aug 17, 2025
One-click install
npx skills add https://github.com/ratnesh-maurya/mdconverter --skill react-ui-patterns-ratnesh-maurya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-ui-patterns
Source: https://github.com/ratnesh-maurya/mdconverter/tree/main/.claude/skills/react-ui-patterns
Command: npx skills add https://github.com/ratnesh-maurya/mdconverter --skill react-ui-patterns-ratnesh-maurya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React components often flash loading spinners over cached data, swallow errors silently, or allow duplicate form submissions, leaving users confused about application state. ## 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 for surfacing errors via inline messages, toasts, banners, or full error screens with retry actions. - Button and Form Patterns: Patterns for disabling buttons during async operations and handling form submissions with validation and feedback. - Use Case: When building a data-driven list page, apply the decision tree to render error, loading, empty, and populated states correctly without stale UI. ## Quick Start Apply the react-ui-patterns skill to review my component's loading, error, and empty state handling.

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 UI flashing?

Show a loading indicator only when loading is true and no data exists yet. Checking loading alone causes spinners to flash over cached data during refetches, 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. Combine the disabled state with form validity so users cannot trigger multiple async operations.

What is the best way to show errors in a React app?

Follow an error hierarchy: inline messages for field validation, toasts for recoverable errors, banners for page-level issues, and full error screens for unrecoverable failures. Never swallow errors with only a console log.

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

The component likely lacks an empty state for the collection. Render an explicit empty state component with an icon, title, description, and optional action when the data array is empty.