A frosted-glass folder with files that peek out, lift on hover, and fan open on click — revealing document details, an add-file button, and a particle burst. Every size is expressed in design units so the whole component scales pixel-perfectly from one `size` prop.
Install the component:
Usage:
app/page.jsx
1<FolderCard label="Invoices" size={260} trigger="hover" />| Prop | Type | Default | Description | Required |
|---|---|---|---|---|
| size | number | 220 | Folder width in px. Every inner size is in design units (1 unit = size/200), so everything scales with it. | No |
| label | ReactNode | "My Files" | Text at the bottom-left of the folder. | No |
| sublabel | function | string | false | (count) => `${count} files` | Small text under the label while hovered/open. A function receives the file count; false hides it. | No |
| count | number | undefined | Override the file count passed to sublabel. | No |
| theme | "light" | "dark" | "light" | Preset colours for stage, glass, back panel, shadow and button. | No |
| items | array | DEFAULT_FOLDER_ITEMS (teal image, document, red image) | Files inside the folder: { type: 'image', palette } or { type: 'image', colors: [4 hexes] }, { type: 'document', accent }, { type: 'custom', content } or { type: 'custom', render }. Optional keys: id, width, height, radius, rotate, x, y, background, className, style. Palettes: teal, red, violet, amber, ocean, forest, rose, mono (exported as FOLDER_PALETTES). | No |
| maxItems | number | 5 | How many files are shown at once. | No |
| open | boolean | undefined (uncontrolled) | Controlled open state. Pair with onOpenChange. | No |
| defaultOpen | boolean | false | Uncontrolled initial open state. | No |
| onOpenChange | (open: boolean) => void | undefined | Called whenever the folder opens or closes. | No |
| trigger | "click" | "hover" | "none" | "click" | What opens it: click, hover, or none (only the open prop controls it). | No |
| hoverLift | boolean | true | Show the soft 'hover' pose before opening. | No |
| closeOnOutsideClick | boolean | true | Click outside closes the folder (click trigger only). | No |
| addOnClick | boolean | true | The '+' button drops a new file into the folder. | No |
| newItems | array | DEFAULT_NEW_ITEMS | Items cycled through by the '+' button. | No |
| openOnAdd | boolean | true | Open the folder when '+' is pressed. | No |
| onAdd | (event) => void | undefined | Fired on every '+' press. | No |
| onItemClick | (item, index, event) => void | undefined | Click a file while the folder is open. | No |
| onFolderClick | (event) => void | undefined | Fired when the glass front is clicked. | No |
| showStage | boolean | true | Render the dotted card behind the folder. | No |
| stage | object | theme preset | Dotted stage card overrides: background, dots, dotColor, dotSize, dotGap, radius, borderColor, shadow, parallax, clip, width, height, offsetY. | No |
| glass | object | theme preset | Glass overrides: blur, saturate, tintTop, tintBottom, borderColor, edgeColor, shine, shineColor, focusColor. | No |
| back | object | theme preset | Back panel overrides: fillTop, fillBottom, borderColor. | No |
| shadow | object | theme preset | Ground shadow overrides: show, color, blur, height, widthRatio. | No |
| shape | object | DEFAULT_SHAPE | Folder silhouette overrides: frontTop, tabWidth, curve, drop, radius, backTop, backTabWidth, backCurve, backDrop. | No |
| button | object | theme preset | '+' button overrides: show, size, radius, right, bottom, background, color, iconSize, strokeWidth, shadow, icon, ariaLabel, className. | No |
| labelStyle | object | theme preset | Label overrides: size, weight, letterSpacing, color, left, subSize, subColor, className, subClassName. | No |
| tilt | number | 6 | Max pointer-follow tilt in degrees. 0 = off. | No |
| spring | { stiffness?, damping?, mass? } | { stiffness: 260, damping: 24, mass: 0.9 } | Spring config for the tilt and pose motion. | No |
| stagger | number | 0.035 | Seconds between files moving. | No |
| intro | boolean | false | Files drop into the folder on mount. | No |
| particles | number | 8 | Dots that burst from '+' on press. 0 = off. | No |
| particleColors | string[] | DEFAULT_PARTICLE_COLORS | Colours of the burst particles. | No |
| poses | object | DEFAULT_POSES | Fine-tune rest/hover/open poses: lift, spread, angle, drop, glassTilt, glassY, folderY, folderScale, shadowScale. | No |
| respectReducedMotion | boolean | true | Obey the OS reduce-motion setting. | No |
| ariaLabel | string | undefined | Screen-reader label of the folder. | No |
| className | string | undefined | Classes for the outer wrapper; state is exposed as data-state=rest|hover|open. | No |
| style | object | undefined | Inline style for the outer wrapper. | No |
| ...rest | object | undefined | Any other props are spread onto the wrapper <div>. | No |