# Suspense Boundary Design

> Design React Suspense boundaries interactively. Use when planning loading states, configuring boundary granularity, or combining with ErrorBoundary.

- Skill: `naporin0624/suspense-boundary-design` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add naporin0624/suspense-boundary-design`
- Raw SKILL.md: https://api.skillmd.com/api/skills/naporin0624/suspense-boundary-design/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: naporin0624 (https://skillmd.com/u/naporin0624)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/naporin0624/suspense-boundary-design

---


# Suspense Boundary Design

## Interview Questions

1. **Loading units** - Which components load independently?
2. **Error handling** - Show error UI, retry button, or bubble up?
3. **Loading UI** - Skeleton, spinner, or shimmer?

## Pattern

```tsx
import { ErrorBoundary } from 'react-error-boundary';

<ErrorBoundary FallbackComponent={ErrorFallback}>
  <Suspense fallback={<Skeleton />}>
    <AsyncComponent />
  </Suspense>
</ErrorBoundary>
```

**Rule: ErrorBoundary wraps Suspense (outside).**

## Best Practices

1. Match skeleton to content size (prevents layout shifts)
2. Avoid nested Suspense unless intentional waterfall
3. Group components sharing data under same boundary

## Related

- [jotai-reactive-atoms/HYBRID-ATOM.md](../jotai-reactive-atoms/HYBRID-ATOM.md) - Suspense with async atoms

