React Ui Patterns
Opinionated React UI patterns for loading, error, empty, and async states, enforcing errors are always surfaced.
- CCM score
- 70 of 100
- skills.sh installs
- 529
- GitHub stars
- 34.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers loading-state decisions, error hierarchy, empty states, button submission states, and form submission flow
- Enforces showing a loading indicator only when no data exists, to avoid flashing spinners on refetch
- Includes a decision tree plus skeleton-versus-spinner guidance, with
ErrorStateandEmptyStatecomponent patterns - Designed for React teams using GraphQL or Formik, and it cross-references testing-patterns for covering UI states
Install
$ npx -y skills add davila7/claude-code-templates --skill react-ui-patterns -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
React UI Patterns
Core Principles
- Never show stale UI - Loading spinners only when actually loading
- Always surface errors - Users must know when something fails
- Optimistic updates - Make the UI feel instant
- Progressive disclosure - Show content as it becomes available
- 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 } = useGetItemsQuery();
if (error) return <ErrorState error={error} onRetry={refetch} />;
if (loading && !data) return <LoadingState />;
if (!data?.items.length) return <EmptyState />;
return <ItemList items={data.items} />;
// WRONG - Shows spinner even when we have cached data
if (loading) return <LoadingState />; // Flashes on refetch!
Loading State Decision Tree
Is there an error?
→ Yes: Show error state with retry option
→ No: Continue
Is it loading AND we have no data?
→ Yes: Show loading indicator (spinner/skeleton)
→ No: Continue
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Frontend & UI Code, Testing & QA
- First seen
- Jun 3, 2026
More from davila7/claude-code-templates
All 398- Docx526
- Marketing Demand Acquisition525
- Research Grants523
- Web Performance Optimization523
- Screenshot Feature Extractor517
- React Patterns503
- Rag Implementation500
- Executing Marketing Campaigns499
- Api Documentation Generator494
- Backend Dev Guidelines494
- Coding Standards494
- Autonomous Agents492
- Typescript Expert491
- Api Patterns486
- Supabase Postgres Best Practices482
- File Organizer481
- Research Engineer478
- App Builder476
- Api Security Best Practices471
- Parallel Agents469
- Manim466
- Senior Secops466
- Computer Use Agents457
- Git Commit Helper456
Similar to React Ui Patterns
More Frontend & UI Codeangular-ui-patternssickn33/agentic-awesome-skills596 installsAngular UI patterns for loading states, error handling, and async data display in components.
react-patternsdavila7/claude-code-templates503 installsModern React principles covering component design, hooks, state selection, composition, performance, and TypeScript typing.
frontend-dev-guidelinesdavila7/claude-code-templates714 installsReact and TypeScript frontend standards covering Suspense data fetching, MUI v7 styling, and TanStack Router conventions.
frontend-patternsaffaan-m/ecc18K installsPatterns for React and Next.js covering components, custom hooks, state management, and render performance.
state-ux-flow-builderpatricio0312rev/skills265 installsConsistent UX state handling for data fetching flows, including loading, error, empty, and success views.