Folder Interaction

An animated folder that fans out image cards on hover or click. Works at any size — from inline badge to standalone card.

Preview 1
Preview 2
Preview 3

Examples

With Hover

Preview 1
Preview 2
Preview 3
Hover Me

With Different Theme

Preview 1
Preview 2
Preview 3

Installation

$ npx shadcn@latest add https://akshitr.com/r/folder-interaction.json

Usage

import { FolderInteraction } from "@/components/folder-interaction";
 
export default function FolderInteractionDemo() {
  return <FolderInteraction />;
}

Component API

FolderInteraction

PropTypeDefaultDescription
images?string[]Up to 3 image URLs to stack inside the folder.
size?number32Folder width in px. Height is derived automatically at a 4:3 ratio.
interaction?FolderInteractionType"click""click" peeks on hover and fans on click. "hover" fans immediately.
color?FolderColor"sky"Folder color theme.
text?stringOptional label rendered beside the folder. Omit for a standalone folder.
href?stringWhen provided, renders as <a>. Otherwise renders as <div>.
target?stringLink target attribute, e.g. "_blank". Automatically adds rel="noopener noreferrer" when "_blank".
className?stringAdditional classes applied to the root element.

FolderColor

type FolderColor =
  | "amber"
  | "sky"
  | "emerald"
  | "rose"
  | "violet"
  | "orange"
  | "indigo"
  | "teal"
  | "pink"
  | "slate";

FolderInteractionType

type FolderInteractionType = "click" | "hover";