state-ux-flow-builder

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

State & UX Flow Builder

状态与UX流程构建器

Create consistent UX flows for all application states: loading, error, empty, and success.
为应用的所有状态(加载、错误、空值、成功)创建一致的UX流程。

Output Components

输出组件

Every implementation includes: (1) Loading skeletons, (2) Error state with retry, (3) Empty state with action, (4) Success view, (5) Error boundary, (6) State management pattern (useState/XState/server).
每个实现都包含:(1) 加载骨架屏,(2) 带重试功能的错误状态,(3) 带操作按钮的空状态,(4) 成功视图,(5) 错误边界,(6) 状态管理模式(useState/XState/服务端)。

Key Patterns

核心模式

Data Fetching Flow: Check loading → Handle error → Show empty → Display data State Machine: XState for complex flows with multiple states and transitions Optimistic Updates: Instant UI feedback with rollback on error Progressive Loading: Show content incrementally as it loads
数据获取流程:检查加载状态 → 处理错误 → 展示空状态 → 显示数据 状态机:使用XState处理包含多状态与状态转换的复杂流程 乐观更新:即时UI反馈,错误时回滚 渐进式加载:随内容加载逐步显示

Best Practices

最佳实践

Always handle all states, prefer skeletons over spinners, provide retry mechanisms, use consistent error/empty UI, add ARIA live regions, implement error boundaries.
始终处理所有状态,优先使用骨架屏而非加载动画,提供重试机制,保持错误/空状态UI的一致性,添加ARIA实时区域,实现错误边界。