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
imagesstring[]Up to 3 image URLs to stack inside the folder.
sizenumber32Folder width in px. Height is derived automatically at a 4:3 ratio.
interactionFolderInteractionType"click""click" peeks on hover and fans on click. "hover" fans immediately.
colorFolderColor"sky"Folder color theme.
textstringOptional label rendered beside the folder. Omit for a standalone folder.
hrefstringWhen provided, renders as <a>. Otherwise renders as <div>.
targetstringLink target attribute, e.g. "_blank". Automatically adds rel="noopener noreferrer" when "_blank".
classNamestringAdditional classes applied to the root element.

FolderColor

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

FolderInteractionType

type FolderInteractionType = "click" | "hover";