A solid reference for handling the UI states that always seem to trip up React developers. Covers the essentials like only showing spinners when there's actually no data (not on every refetch), surfacing errors to users instead of silently logging them, and always disabling buttons during async operations. The decision trees and anti-pattern examples are genuinely helpful for code review. It's opinionated in the right ways, like the "never show stale UI" principle and the error handling hierarchy. Most useful when you're building data-heavy UIs and want consistent patterns across your codebase rather than reinventing loading states for every component.

skills.sh installs
1.2K
GitHub stars
43.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add sickn33/antigravity-awesome-skills --skill react-ui-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

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();

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

Sponsors

Details

Repository
github.com/sickn33/antigravity-awesome-skills
Category
Frontend Development

More from sickn33/antigravity-awesome-skills

All 708
1syncfusion avatarsyncfusion-react-diagramsyncfusion/react-ui-components-skillsCreate and customize visual diagrams in React using Syncfusion Diagrams. Trigger for requests involving React component setup, nodes and connectors, flowcharts,746skills.sh installs
2syncfusion avatarsyncfusion-react-chat-uisyncfusion/react-ui-components-skillsImplement the Syncfusion React Chat UI component. Use this skill to create and customize messaging interfaces, including chat setup, message rendering, file att740skills.sh installs
3syncfusion avatarsyncfusion-react-pivot-tablesyncfusion/react-ui-components-skillsUse this skill when users ask how to build or customize Syncfusion PivotView pivot tables in React. Trigger for React pivot grid/OLAP, aggregation, data binding734skills.sh installs
4syncfusion avatarsyncfusion-react-ribbonsyncfusion/react-ui-components-skillsImplement the Syncfusion React Ribbon component. Use this skill for creating Ribbon UIs with tabs, groups, items, Classic or Simplified layouts, file menu and b725skills.sh installs
5syncfusion avatarsyncfusion-react-appbarsyncfusion/react-ui-components-skillsCreate responsive navigation headers with AppBar component. Build top, bottom, or sticky app bars with buttons, menus, icons, and sidebars. Use when building na686skills.sh installs
6syncfusion avatarsyncfusion-react-sidebarsyncfusion/react-ui-components-skillsImplement responsive Syncfusion React Sidebar component for navigation layouts. Use this when building responsive navigation menus, drawer layouts, or collapsib681skills.sh installs