Introducing Aceternity UI Pro - 70+ premium component packs and templates to build amazing websites.
Logo

Apple Cards Carousel

A sleek and minimal carousel implementation, as seen on apple.com

Open in

Get to know your iSad.

Installation

Run the following command

npx shadcn@latest add @aceternity/apple-cards-carousel

Add useOutsideClick hook

hooks/use-outside-click.ts
import React, { useEffect } from "react";
 
export const useOutsideClick = (
  ref: React.RefObject<HTMLDivElement>,
  callback: Function
) => {
  useEffect(() => {
    const listener = (event: any) => {
      if (!ref.current || ref.current.contains(event.target)) {
        return;
      }
      callback(event);
    };
 
    document.addEventListener("mousedown", listener);
    document.addEventListener("touchstart", listener);
 
    return () => {
      document.removeEventListener("mousedown", listener);
      document.removeEventListener("touchstart", listener);
    };
  }, [ref, callback]);
};

Examples

Standard

Open in

Get to know your iSad.

With Layout Changes

Open in

Get to know your iSad.

Props

PropTypeDefaultDescription
itemsJSX.Element[]RequiredArray of JSX elements to be displayed in the carousel
initialScrollnumber0Initial scroll position of the carousel

Card Component

PropTypeDefaultDescription
cardCardRequiredObject containing card details (src, title, category, content)
indexnumberRequiredIndex of the card in the carousel
layoutbooleanfalseWhether to use layout animations

BlurImage Component

PropTypeDefaultDescription
heightnumber | string-Height of the image
widthnumber | string-Width of the image
srcstringRequiredSource URL of the image
classNamestring-Additional CSS classes for the image
altstring"Background of a beautiful view"Alt text for the image
...restImageProps-Any other props accepted by Next.js Image component

Note: The Card type is defined as:

type Card = {
  src: string;
  title: string;
  category: string;
  content: React.ReactNode;
};

Build websites faster and 10x better than your competitors with

Aceternity UI Pro

Next.js 15, Tailwind CSS v4 and Motion for react powered templates

70+ templates and component blocks combined

Ready to copy paste component blocks, save days of development time

Aceternity UI Pro Demo - Light Mode
A product by Aceternity
Building in public at @mannupaaji