home / skills / dylantarre / animation-principles / carousels-sliders

carousels-sliders skill

/skills/07-by-ui-element/carousels-sliders

This skill helps you implement Disney-inspired carousel and slider animations for smooth, intuitive navigation across content.

npx playbooks add skill dylantarre/animation-principles --skill carousels-sliders

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

Files (1)
SKILL.md
2.9 KB
---
name: carousels-sliders
description: Use when animating carousels, sliders, image galleries, or horizontally scrolling content for smooth navigation
---

# Carousel & Slider Animation Principles

Apply Disney's 12 principles to carousels and sliders for smooth, intuitive navigation.

## Principles Applied to Carousels

### 1. Squash & Stretch
Slides can slightly compress in scroll direction during fast swipes. Expands perception of speed and momentum.

### 2. Anticipation
Before slide change, current slide can shift 5-10px in direction of navigation. Button can depress before triggering.

### 3. Staging
Current/active slide should be prominently displayed: larger, centered, more opaque. Adjacent slides can be dimmed or scaled down.

### 4. Straight Ahead & Pose to Pose
Use pose-to-pose: define exact positions for each slide. Snap points should be clear and predictable.

### 5. Follow Through & Overlapping Action
After snap, slide can overshoot slightly and settle back. Content within slide (text, buttons) lags behind container movement.

### 6. Ease In & Ease Out
Swipe release: `ease-out` (momentum slowdown). Button navigation: `ease-in-out`. `cubic-bezier(0.25, 0.1, 0.25, 1)` for smooth slides.

### 7. Arcs
3D carousels should rotate slides along curved paths. Coverflow effects follow arc naturally. Even flat carousels can have subtle Y movement.

### 8. Secondary Action
While slide moves (primary), pagination updates (secondary), adjacent slides scale/fade (tertiary), progress bar moves (quaternary).

### 9. Timing
- Slide transition: 300-500ms
- Swipe momentum: 200-400ms
- Pagination dot: 150ms
- Autoplay interval: 4000-6000ms
- Pause on hover: immediate
- Adjacent slide scale: 250ms

### 10. Exaggeration
Hero carousels can use more dramatic transitions. Product carousels should be smoother, less distracting. Scale to context.

### 11. Solid Drawing
Maintain consistent slide dimensions. Gaps should stay uniform. Aspect ratios must be preserved during any transforms.

### 12. Appeal
Smooth carousels feel premium. Janky sliders feel cheap. Touch response should feel native. Investment here pays dividends.

## CSS Implementation

```css
.carousel-track {
  display: flex;
  transition: transform 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.carousel-slide {
  flex-shrink: 0;
  transition: transform 300ms ease-out,
              opacity 300ms ease-out;
}

.carousel-slide:not(.active) {
  transform: scale(0.9);
  opacity: 0.6;
}

.pagination-dot {
  transition: transform 150ms ease-out,
              background-color 150ms ease-out;
}

.pagination-dot.active {
  transform: scale(1.3);
}

/* CSS scroll snap */
.carousel-container {
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.carousel-slide {
  scroll-snap-align: center;
}
```

## Key Properties
- `transform`: translateX, scale
- `opacity`: inactive slides
- `scroll-snap-type`: native snapping
- `scroll-behavior`: smooth scrolling
- `transition`: slide movements

Overview

This skill applies Disney’s 12 animation principles to carousels, sliders, image galleries, and horizontally scrolling content to create smooth, intuitive navigation. It provides practical guidance and CSS-ready defaults for momentum, snapping, and visual polish that improve perceived quality and touch responsiveness. Use it to make carousels feel native, predictable, and premium.

How this skill works

The skill inspects common carousel behaviors and maps each animation principle to concrete UI patterns: squash & stretch for swipe speed, anticipation for button and slide cues, and ease-in/ease-out timing for natural motion. It recommends transition durations, easing curves, and transform/opacity patterns, plus CSS scroll-snap and sample transitions to implement them consistently. The result is coordinated primary and secondary actions (slide movement, pagination, progress) that feel responsive on both mouse and touch.

When to use it

  • Building or refining hero carousels on marketing pages
  • Designing product or content carousels in e-commerce or media sites
  • Implementing touch-first galleries for mobile apps or PWAs
  • Improving UX of horizontally scrolling lists or timeline components
  • Adding subtle polish to pagination, autoplay, or coverflow effects

Best practices

  • Use pose-to-pose snap points so users predict where content rests
  • Keep transition windows short: 300–500ms for slide moves, quicker for UI accents
  • Apply ease-out for swipe momentum and ease-in-out for button-triggered moves
  • Preserve aspect ratios and consistent gaps to avoid layout jank
  • Layer secondary actions: update pagination and scale adjacent slides rather than abrupt swaps

Example use cases

  • Hero banner: larger active slide, dimmed adjacent slides, dramatic easing for storytelling
  • Product carousel: subtle scale and opacity shifts, fast snap for discoverability
  • Image gallery: squash/stretch on rapid swipes to convey momentum
  • Coverflow/3D slider: apply arcs and Y-movement for pleasing rotation paths
  • Autoplay carousel: 4–6s interval with immediate pause-on-hover and smooth settle animations

FAQ

What timing and easing should I use for smooth slides?

Use 300–500ms for main slide transitions with cubic-bezier(0.25,0.1,0.25,1). Use 150–250ms for pagination and micro-interactions; use ease-out for swipe momentum and ease-in-out for button-triggered moves.

How do I avoid layout shifting during transforms?

Keep solid drawing: maintain fixed slide dimensions, uniform gaps, and preserve aspect ratios. Animate transforms and opacity only; avoid animating layout properties like width or margin during transitions.