What the fallback Prop Accepts
What you'll learn: The flexible types of UI you can show while components are suspended.
Any Valid React Element Works
The fallback prop on a Suspense boundary isn't picky—it accepts any valid React element. This gives you complete control over what users see during loading states.
You can pass:
- Plain strings:
<Suspense fallback="Loading..."> - JSX elements:
<Suspense fallback={<div className="spinner" />}> - Full components:
<Suspense fallback={<SkeletonLayout />}> - Fragments:
<Suspense fallback={<><Spinner /><p>Please wait</p></>}>
Think of It Like a Placeholder Slot
Imagine a picture frame that temporarily holds different placeholders while you wait for the real photo to arrive. The frame doesn't care if you put a "Coming Soon" card, a blank sheet, or an artistic sketch—anything that fits works. The fallback prop is that flexible slot.
// Simple text
<Suspense fallback="Loading...">
<LazyComponent />
</Suspense>
// Rich UI
<Suspense fallback={
<>
<Skeleton width="100%" height={200} />
<Skeleton width="80%" height={20} />
</>
}>
<DataDrivenComponent />
</Suspense>
Freedom with Consistency
This flexibility means you can match your fallback UI to your brand—use your design system's spinners, skeleton screens that mirror content layout, or even playful loading animations. The only requirement is that it must be something React can render immediately.
Key Takeaway: The fallback prop accepts strings, components, or any JSX—giving you complete creative control over loading states while Suspense handles the coordination.