前端开发

react-ui-patterns

sickn33/agentic…e-skills

Modern React UI patterns for loading states, error handling, and data fetching. Use when building UI components, handling async data, or managing UI states.

  • 1485 次安装
  • 4.9万 星标
  • 收录于

安装命令

npx skills add https://github.com/sickn33/agentic-awesome-skills --skill react-ui-patterns

SKILL.md

React UI Patterns

Core Principles

  1. Never show stale UI - Loading spinners only when actually loading
  2. Always surface errors - Users must know when something fails
  3. Optimistic updates - Make the UI feel instant
  4. Progressive disclosure - Show content as it becomes available
  5. Graceful degradation - Partial data is better than no data

Loading State Patterns

The Golden Rule

Show loading indicator ONLY when there's no data to display.

// CORRECT - Only show loading when no data exists
const { data, loading, error, refetch } = useGetItemsQuery();