Apple Card Carousel

A sleek, Apple‑style card carousel with blur‑loading images, modal expansion, and smooth scrolling controls.

Overview

The Apple Carousel suite is composed of four inter‑related components:

ComponentPurpose
AppleCardCarouselThe horizontal scroll container with left / right controls.
AppleCarouselItemA wrapper that adds enter‑animation and spacing to each card.
AppleCardA richly styled, clickable card that can expand into a fullscreen modal.
AppleBlurImageAn <img> replacement that starts blurred until the image loads.

Together they reproduce the interactive “App Store / Apple TV” browsing experience.


AppleCardCarousel

PropTypeDefaultDescription
initialScrollnumber0Horizontal scroll offset applied on mount (in px).

Slots

The default slot should contain one or more AppleCarouselItem components.

Emits

No custom events.


AppleCarouselItem

PropTypeRequiredDescription
indexnumberZero‑based index; used to stagger the appear animation.

Slots

Default slot — place an AppleCard here.


AppleCard

PropTypeRequiredDefaultDescription
card{ src: string; title: string; category: string }Data object for the card.
indexnumberPosition within the carousel.
layoutbooleanfalseEnables shared‑layout FLIP animation.

Slots

When the card is expanded (modal open) the default slot renders inside the modal body; you can inject extended content such as text, images, or videos.

Emits

No custom events (relies on injected CarouselKey context).


AppleBlurImage

PropTypeDefaultDescription
srcstringImage source URL. Required.
altstring"Background of a beautiful view"Alt text.
widthnumber | stringimg naturalWidth attribute; omitted when using fill.
heightnumber | stringimg naturalHeight attribute; omitted when using fill.
fillbooleanfalseIf true, sets width:100%; height:100% via utility classes.
classstring""Additional classes merged via cn().

When the image fires the native load event it gracefully transitions from blur-sm to no‑blur.


Install using CLI

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://inspira-ui.com/r/apple-card-carousel.json"

Install Manually

Copy and paste the following code in the same folder

AppleCardCarousel.vue
AppleCarouselItem.vue
AppleCard.vue
AppleBlurImage.vue
AppleCarouselContext.ts

Features

  • Blur‑Up Images — Pleasant loading for card thumbnails.
  • Shared Layout Animation — Optional FLIP animation between thumbnail and modal using layoutId.
  • Keyboard & Click Outside Close — ⌘‑style modal dismissal (Esc key or outside click).
  • Accessible Scrolling Controls — Prev / next buttons with disabled state.
  • Mobile‑Aware Scroll Calculations — Ensures cards recentre correctly when closed on small screens.

Credits