SKILL

react-ui-patterns

用于加载状态、错误处理和数据获取的现代 React UI 模式。适用于构建 UI 组件、处理异步数据或管理 UI 状态时。

机器翻译
查看英文原文

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

适用对象:React / Next.js。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • React UI Patterns
  • Core Principles
  • Loading State Patterns
  • The Golden Rule
  • Loading State Decision Tree
  • Skeleton vs Spinner
  • Error Handling Patterns
  • The Error Handling Hierarchy

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 Show loading indicator ONLY when there's no data to display. | 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 | CRITICAL: Never swallow errors silently. CRITICAL: Always disable triggers during async operations. Every list/collection MUST have an empty state: Before completing any UI component: UI States: [ ] Error state handled and shown to user [ ] Loading state shown only when no data exists [ ] Empty state provided for collections [ ] Buttons disabled during async operations [ ] Buttons show loading indicator when appropriate Data & Mutations: [ ] Mutations have onError handler [ ] All user actions have feedback (toast/visual) graphql-schema: Use mutation patterns with prop

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
davila7/claude-code-templates
源文件
cli-tool/components/skills/development/react-ui-patterns/SKILL.md
固定版本
21be197f100a12b8d0dd9a211cc244c8179f84d3
阅读完整原作者说明 ↗

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:davila7/claude-code-templates · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T14:01:44.666Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。