Dice UI

Stack

Cards

About

A stacked card/notification layout (like Sonner's toast stacking) whose items expand into a fanned-out list on hover.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Stack to your project and fits it to your theme.

Code

How Stack is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Stack, StackItem } from "@/components/ui/stack";

export default function StackNoExpandDemo() {
  return (
    <div className="flex min-h-[400px] items-center justify-center">
      <Stack expandOnHover={false} className="w-[360px]">
        <StackItem className="flex flex-col gap-2">
          <h3 className="font-semibold">Static Stack</h3>
          <p className="text-sm text-muted-foreground">
            This stack doesn't expand on hover
          </p>
        </StackItem>
        <StackItem className="flex flex-col gap-2">
          <h3 className="font-semibold">Item 2</h3>
          <p className="text-sm text-muted-foreground">
            The stacking effect remains constant
          </p>
        </StackItem>
        <StackItem className="flex flex-col gap-2">
          <h3 className="font-semibold">Item 3</h3>
          <p className="text-sm text-muted-foreground">
            Perfect for permanent visual hierarchy
          </p>
        </StackItem>
      </Stack>
    </div>
  );
}

Dependencies

More by Dice UI

View all
  • Compare Slider

    Compare Slider

    89
  • Sortable

    Sortable

    55
  • Circular Progress

    Circular Progress

    45
  • Status

    Status

    42
  • Pending

    Pending

    34
  • Banner

    Banner

    25
  • Kanban Board

    Kanban Board

    15
  • Marquee

    Marquee

    12

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.3K
  • Photo Deck

    Photo Deck

    47
  • Folded Card

    Folded Card

    45
  • Statistics Card 10

    Statistics Card 10

    304
  • Statistics Card 2

    Statistics Card 2

    309
  • Statistics Card 7

    Statistics Card 7

    336
  • CTA Section

    CTA Section

    6
  • Liquid Glass Card

    Liquid Glass Card

    198

Explore more

Part of Dice UI — browse the full library on 21st.dev.