React UI patterns for loading states, error handling, and async data in components.
Works with
Three core patterns: show loading indicators only when data is absent, always surface errors to users, and disable buttons during async operations to prevent duplicate submissions
Includes decision trees and component examples for skeleton vs. spinner selection, error state hierarchy (inline, toast, banner, full screen), and empty state requirements for all collections
Covers form submission workflows
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionreact-ui-patternsExecute the skills CLI command in your project's root directory to begin installation:
Fetches react-ui-patterns from davila7/claude-code-templates and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate react-ui-patterns. Access via /react-ui-patterns in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
24.2K
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
24.2K
stars
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!
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
Do we have data?
→ Yes, with items: Show the data
→ Yes, but empty: Show empty state
→ No: Show loading (fallback)
| Use Skeleton When | Use Spinner When |
|---|---|
| Known content shape | Unknown content shape |
| List/card layouts | Modal actions |
| Initial page load | Button submissions |
| Content placeholders | Inline operations |
1. Inline error (field-level) → Form validation errors
2. Toast notification → Recoverable errors, user can retry
3. Error banner → Page-level errors, data still partially usable
4. Full error screen → Unrecoverable, needs user action
CRITICAL: Never swallow errors silently.
// CORRECT - Error always surfaced to user
const [createItem, { loading }] = useCreateItemMutation({
onCompleted: () => {
toast.success({ title: 'Item created' });
},
onError: (error) => {
console.error('createItem failed:', error);
toast.error({ title: 'Failed to create item' });
},
});
// WRONG - Error silently caught, user has no idea
const [createItem] = useCreateItemMutation({
onError: (error) => {
console.error(error); // User sees nothing!
},
});
interface ErrorStateProps {
error: Error;
onRetry?: () => void;
title?: string;
}
const ErrorState = ({ error, onRetry, title }: ErrorStateProps) => (
<div className="error-state">
<Icon name="exclamation-circle" />
<h3>{title ?? 'Something went wrong'}</h3>
<p>{error.message}</p>
{onRetry && (
<Button onClick={onRetry}>Try Again</Button>
)}
</div>
);
<Button
onClick={handleSubmit}
isLoading={isSubmitting}
disabled={!isValid || isSubmitting}
>
Submit
</Button>
CRITICAL: Always disable triggers during async operations.
// CORRECT - Button disabled while loading
<Button
disabled={isSubmitting}
isLoading={isSubmitting}
onClick={handleSubmit}
>
Submit
</Button>
// WRONG - User can tap multiple times
<Button onClick={handleSubmit}>
{isSubmitting ? 'Submitting...' : 'Submit'}
</Button>
Every list/collection MUST have an empty state:
// WRONG - No empty state
return <FlatList data={items} />;
// CORRECT - Explicit empty state
return (
<FlatList
data={items}
ListEmptyComponent={<EmptyState />}
/>
);
// Search with no results
<EmptyState
icon="search"
title="No results found"
description="Try different search terms"
/>
// List with no items yet
<EmptyState
icon="plus-circle"
title="No items yet"
description="Create your first item"
action=Implementation Guide
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Steps
- 1Install skill using provided installation command
- 2Test with simple use case relevant to your work
- 3Evaluate output quality and relevance
- 4Iterate on prompts to improve results
- 5Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Related Skills
ml-paper-writing
76davila7/claude-code-templates
AI/MLsame reporeact-vite-best-practices
58asyrafhussin/agent-skills
Frontendtag: reactfrontend-design
661anthropics/claude-code
Frontendsame categoryui-animation
242mblode/agent-skills
Frontendsame categorypremium-frontend-ui
236github/awesome-copilot
Frontendsame categoryantigravity-design-expert
209sickn33/antigravity-awesome-skills
Frontendsame categoryReviews
4.5★★★★★72 reviews- CChaitanya Patil★★★★★Dec 28, 2024
Solid pick for teams standardizing on skills: react-ui-patterns is focused, and the summary matches what you get after install.
- MMia Huang★★★★★Dec 24, 2024
We added react-ui-patterns from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- NNikhil Abbas★★★★★Dec 20, 2024
Registry listing for react-ui-patterns matched our evaluation — installs cleanly and behaves as described in the markdown.
- KKabir Johnson★★★★★Dec 16, 2024
Keeps context tight: react-ui-patterns is the kind of skill you can hand to a new teammate without a long onboarding doc.
- EEmma Haddad★★★★★Dec 12, 2024
Solid pick for teams standardizing on skills: react-ui-patterns is focused, and the summary matches what you get after install.
- PPiyush G★★★★★Nov 19, 2024
We added react-ui-patterns from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- MMia Abbas★★★★★Nov 19, 2024
Useful defaults in react-ui-patterns — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- MMia Rahman★★★★★Nov 15, 2024
Solid pick for teams standardizing on skills: react-ui-patterns is focused, and the summary matches what you get after install.
- MMichael Wang★★★★★Nov 7, 2024
Registry listing for react-ui-patterns matched our evaluation — installs cleanly and behaves as described in the markdown.
- JJames Li★★★★★Nov 3, 2024
We added react-ui-patterns from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 72
1 / 8Discussion
Comments — not star reviews- No comments yet — start the thread.