react-ui-patterns

Implement React UI patterns for loading, error, and empty states in data-fetching components.

Updated Jan 22, 2026
One-click install
npx skills add https://github.com/createdbysalt/nextjs-starter-template --skill react-ui-patterns-createdbysalt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-ui-patterns
Source: https://github.com/createdbysalt/nextjs-starter-template/tree/main/.claude/skills/react-ui-patterns
Command: npx skills add https://github.com/createdbysalt/nextjs-starter-template --skill react-ui-patterns-createdbysalt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps frontend developers implement robust UI patterns in React to manage loading, error states, and asynchronous data; it reduces flicker, prevents silent failures, and provides a consistent user experience.

Core Features & Use Cases

  • Loading state patterns: show indicators only when data is actually loading.
  • Error handling patterns: surface errors clearly with recoverable actions.
  • Empty and placeholder states: present meaningful UI when no data is available.
  • Button and interaction states: disable triggers during async ops and reflect progress.

Quick Start

Apply these patterns when building a data-driven component: ensure loading appears only if there is no data, render explicit error states on fetch failures, and display an empty state when results are empty. Then implement a small component that fetches data and demonstrates each state.

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 and error states when fetching data in React components?

To handle loading and error states in React data fetching, render explicit UI indicators only when data is actively loading, and surface clear error messages with recoverable actions upon fetch failures. This prevents silent failures and UI flicker.

What is the best way to prevent stale UI and flickering during asynchronous data fetching in React?

Preventing stale UI and flickering in React asynchronous data fetching involves showing loading indicators only when there is no existing data, ensuring smooth transitions between success and pending states without disrupting the user experience.

How do I display an empty state in a React component when a data fetch returns no results?

To display an empty state in a React component when a data fetch returns no results, render a meaningful placeholder UI that clearly communicates the absence of data rather than leaving the interface blank or showing an error.

Can I use these React UI patterns to disable buttons during asynchronous operations?

Yes, you can use these React UI patterns to disable buttons during asynchronous operations. The patterns help reflect progress accurately and prevent duplicate triggers by disabling interaction elements while data fetching is in progress.

Does this Skill work with standard React components or do I need external state management libraries?

This Skill works directly with standard React frontend components that fetch remote data. It provides UI patterns for loading, error handling, and empty states without requiring any external dependencies or state management libraries.