home / skills / dylantarre / animation-principles / loading-states

This skill helps you implement Disney-inspired loading states by applying squash and stretch, anticipation, and skeleton shimmer for engaging progress feedback.

npx playbooks add skill dylantarre/animation-principles --skill loading-states

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.1 KB
---
name: loading-states
description: Use when indicating progress or waiting - spinners, progress bars, skeleton screens, shimmer effects, or any animation showing the system is working.
---

# Loading State Animations

Apply Disney's 12 principles to communicate system activity.

## Principle Application

**Squash & Stretch**: Progress indicators can pulse/breathe to show life. Slight scale oscillation (0.98-1.02).

**Anticipation**: Show loading state immediately on action. Don't wait for slow response to show spinner.

**Staging**: Loading indicators appear where content will be. Skeleton screens match final layout.

**Straight Ahead vs Pose-to-Pose**: Design loading as a sequence: instant indicator → progress → completion → content.

**Follow Through & Overlapping**: Loading fades as content enters. Overlap the transition by 100ms.

**Slow In/Slow Out**: Progress bars ease-in-out between known percentages. Indeterminate uses smooth oscillation.

**Arcs**: Circular spinners follow true circular paths. Avoid jerky rotation.

**Secondary Action**: Skeleton shimmer + subtle pulse. Multiple signals reinforce "loading."

**Timing**:
- Show spinner after 200ms delay (avoid flash for fast loads)
- Minimum display: 500ms (prevent jarring flash)
- Skeleton shimmer cycle: 1500-2000ms

**Exaggeration**: Keep minimal - loading shouldn't distract, just reassure.

**Solid Drawing**: Skeletons should match content proportions. Wrong shapes break the illusion.

**Appeal**: Loading should feel optimistic, not tedious. Smooth motion suggests progress.

## Timing Recommendations

| Loading Type | Appear Delay | Min Display | Animation Cycle |
|-------------|--------------|-------------|-----------------|
| Spinner | 200ms | 500ms | 700-800ms |
| Progress Bar | 0ms | - | smooth fill |
| Skeleton | 0ms | 500ms | 1500ms shimmer |
| Button Spinner | 0ms | 400ms | 600ms |
| Full Page | 100ms | 800ms | 1000ms |

## Implementation Patterns

```css
/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(
    90deg,
    #e0e0e0 0%,
    #f0f0f0 50%,
    #e0e0e0 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1500ms ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Spinner with smooth rotation */
.spinner {
  animation: spin 700ms linear infinite;
  opacity: 0;
  animation: fade-in 200ms 200ms ease-out forwards, spin 700ms linear infinite;
}

/* Progress bar with easing */
.progress-fill {
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
```

## Loading-to-Content Transition

```css
.content-enter {
  animation: content-reveal 300ms ease-out forwards;
}

@keyframes content-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
```

## Key Rules

1. Delay spinner appearance by 200ms to avoid flash
2. Keep loading visible minimum 500ms once shown
3. Skeleton shapes must match real content dimensions
4. Transition smoothly from loading to content - never pop
5. Respect `prefers-reduced-motion` - show static indicator instead

Overview

This skill captures best practices for designing loading-state animations using principles adapted from Disney’s 12 animation principles. It provides timing rules, motion guidelines, and implementation patterns for spinners, progress bars, skeleton screens, shimmer effects, and transitions that communicate progress without distracting users.

How this skill works

The skill inspects loading scenarios and recommends animation patterns, delays, and minimum display times to balance responsiveness and perceptual stability. It prescribes where to place indicators (staged in the final content location), how to animate them (smooth easing, subtle scale, circular arcs), and how to transition to real content with overlapping fades and movement.

When to use it

  • When showing activity after a user action that may take perceptible time
  • For full-page, component-level, or button-level loading states
  • When replacing content with skeletons while fetching data
  • To reveal incremental progress for long-running tasks
  • When you need accessibility-friendly alternatives for motion-sensitive users

Best practices

  • Delay spinner appearance by 200ms to avoid flashes; keep visible at least 500ms once shown
  • Match skeleton shapes and proportions to final content to preserve layout and expectation
  • Use slow-in/slow-out easing and smooth circular paths to avoid jerky motion
  • Overlap loading fade-out with content entrance by ~100ms for seamless transitions
  • Respect prefers-reduced-motion: provide static placeholders or simple fades instead of full animation
  • Limit exaggeration — animations should reassure, not distract

Example use cases

  • Button-level action: show a small spinner inside the button with 0ms appear and 400ms minimum display
  • List loading: display skeleton rows with 1500–2000ms shimmer cycles while data loads
  • Full-page load: show a centered spinner after 100–200ms and transition to content with a 300ms ease-out
  • Progress-driven task: animate a progress bar with eased fills and occasional subtle pulses to indicate liveliness
  • Image/asset placeholders: use skeleton blocks matching image proportions and shimmer until assets decode

FAQ

When should I show a spinner vs a skeleton?

Use skeletons when you can predict layout and want to reduce perceived load time; use spinners for short indeterminate waits or small actions where structure is not needed.

What are safe animation durations?

Use shimmer cycles of 1500–2000ms, spinner rotations of 700–800ms, and content reveal animations around 300ms for natural-feeling motion.