Loading States

Loading States

Patterns for communicating loading progress, keeping users informed, and maintaining perceived performance.

Instant

<100ms — No indicator needed. Action feels immediate.

Brief

100ms–1s — Use spinner. Show after 200ms delay.

Moderate

1–10s — Use skeleton or progress. Keep user engaged.

Extended

>10s — Show progress %, allow background or cancel.

Spinners

Use spinners for short, indeterminate loading states where you can't show progress.

Button loading

Disable button and show spinner during action

Form submission

Inline loading

Small spinner next to content being updated

Partial refresh
Updating...

Centered spinner

Full container loading state

Page/section load

Loading content...

Overlay spinner

Blocks interaction while loading

Critical operations

Content underneath

Spinner Best Practices

Do
  • Add 200ms delay before showing spinner
  • Include loading text for context
  • Disable interactive elements during load
  • Use appropriate size for context
Don't
  • Show spinner for very fast operations
  • Use spinner for >10 second operations
  • Stack multiple spinners
  • Leave users without cancellation option for long loads

Skeletons

Use skeleton screens to show the layout structure while content loads. Reduces perceived loading time.

Card skeleton

Placeholder for card-based content

Dashboard cards

List skeleton

Placeholder for list items

Table/list data

Text skeleton

Placeholder for text content

Article/description

Image skeleton

Placeholder for images/media

Image gallery

Skeleton Guidelines

  • Match the layout: Skeleton should closely mirror the actual content structure and dimensions
  • Use subtle animation: A gentle pulse or shimmer effect indicates loading without being distracting
  • Avoid text labels: The shape itself should communicate what's loading, not placeholder text
  • Load progressively: Replace skeletons with real content as it arrives, don't wait for everything

Progress Indicators

Use progress bars when you can calculate or estimate how much of the operation is complete.

Determinate progress

Shows exact progress percentage

File upload
Uploading...67%

Indeterminate progress

Shows activity without known duration

Background sync
Processing...

Multi-step progress

Shows progress through multiple stages

Multi-step wizard
Step 2 of 450%
DetailsReviewPaymentConfirm

Upload progress

File upload with cancel option

Large file upload
report.pdf

2.3 MB of 5.1 MB

Optimistic Updates

Show changes immediately while saving in the background. Roll back if the save fails.

When to Use Optimistic UI

Good candidates
  • • Toggling favorites/likes
  • • Marking items as read/complete
  • • Reordering lists
  • • Editing inline content
  • • Deleting items (with undo)
Not recommended
  • • Payment transactions
  • • Creating new resources
  • • Actions that send emails/notifications
  • • Anything requiring validation
  • • Irreversible destructive actions

Optimistic Update Flow

// 1. Update UI immediately
setTasks(tasks.map(t =>
t.id === id ? { ...t, completed: true } : t
))
// 2. Make API call in background
try {
await updateTask(id, { completed: true })
} catch (error) {
// 3. Roll back on failure
setTasks(originalTasks)
toast.error('Failed to update task')
}

Failed Loading States

Always provide a way to recover when loading fails.

Retry option

Let users try again after failure

Network error

Failed to load

Check your connection and try again

Partial failure

Some content loaded, some failed

Multiple requests

Successfully loaded content

Failed to load comments

Loading Pattern Decision Tree

DurationPatternExample Use CaseNotes
<100msNoneButton clickFeels instant
100ms–1sSpinnerForm submissionShow after 200ms delay
1–5sSkeletonPage loadMatch content structure
5–30sProgress barFile uploadShow percentage
>30sBackground taskVideo processingEmail when done