DocsComponentsLayered Stack

Layered Stack

A stack of layered cards that reset and spring out on mouse interactions.

Installation

pnpm dlx shadcn@latest add @componentry/layered-stack

Dependencies: gsap

Usage

API Reference

PropTypeDefault
childrenReactNode

The layered items inside the stack.

—
classNamestring

Additional CSS classes for styling.

—

Keep in mind

This component is inspired by various open-source projects and patterns. Please verify licenses and implementation details before using in production.

Need a custom component?

I build bespoke UI components & websites tailored to your brand.

DM me on X
PreviousHover TransitionNextLens Clock
Modern house exterior at dusk with warm interior lightsPortrait of a woman seen through rippled glassBlurred figures dancing in a red-lit roomBlack-and-white motion-blurred figure covering their faceTurquoise river winding through a misty canyonMotion-blurred man walking against a green-gray backdropBlack-and-white photo of a man seated against a reflective wallHeavily motion-blurred portrait of a person in a striped shirt
import { LayeredStack } from "@/components/ui/layered-stack"
 
const images = [
    {
        src: "https://images.unsplash.com/photo-1600585154340-be6161a56a0c?w=900&h=1200&q=85&auto=format&fit=crop",
        alt: "Modern house exterior at dusk with warm interior lights",
    },
    {
        src: "https://images.unsplash.com/photo-1514906689926-25ba6dcb584b?w=900&h=1200&q=85&auto=format&fit=crop",
        alt: "Portrait of a woman seen through rippled glass",
    },
    {
        src: "https://images.unsplash.com/photo-1568557412756-7d219873dd11?w=900&h=1200&q=85&auto=format&fit=crop",
        alt: "Blurred figures dancing in a red-lit room",
    },
    {
        src: "https://images.unsplash.com/photo-1581892805885-73bdd91beff0?w=900&h=1200&q=85&auto=format&fit=crop",
        alt: "Black-and-white motion-blurred figure covering their face",
    },
    {
        src: "https://images.unsplash.com/photo-1482938289607-e9573fc25ebb?w=900&h=1200&q=85&auto=format&fit=crop",
        alt: "Turquoise river winding through a misty canyon",
    },
    {
        src: "https://images.unsplash.com/photo-1610846202780-b4d9837371ea?w=900&h=1200&q=85&auto=format&fit=crop",
        alt: "Motion-blurred man walking against a green-gray backdrop",
    },
    {
        src: "https://images.unsplash.com/photo-1527630941-4a229fd674ab?w=900&h=1200&q=85&auto=format&fit=crop",
        alt: "Black-and-white photo of a man seated against a reflective wall",
    },
    {
        src: "https://images.unsplash.com/photo-1603786420263-ad59136a7409?w=900&h=1200&q=85&auto=format&fit=crop",
        alt: "Heavily motion-blurred portrait of a person in a striped shirt",
    },
];
 
export const Demo = () => {
    return (
        <LayeredStack className="w-full max-w-[920px] grid grid-cols-4 gap-4 p-8">
            {images.map((img, i) => (
                <img key={i} src={img.src} alt={img.alt} className="object-cover w-full aspect-[250/320] shadow-xl" />
            ))}
        </LayeredStack>
    );
};