Folder
color and the pocket, icon and cards all derive their shades from it in OKLCH. Pass files with thumbnails to show real photos, names to get hover tooltips, or switch on interactive to make it a drag-and-drop upload target with progress bars — that example lives on the File Upload page.Folder
Hover, tap or focus the folder to fan the cards out.
peek- is how many skeleton cards to show when no
filesare given —0is an empty folder,3(default) is filled. size- is the folder width in pixels; height, tab, corner radius and card sizes all derive from it.
color- defaults to a soft tint of
--primary(lightness 0.88, chroma at 40%), so the folder — body, pocket, icon and the peeking cards — follows your theme preset and the colour picker above without going heavy. Pass any CSS colour to pin one.
Installation
New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @algorize-ui registry once, then copy your styles from the Themes page.
Two builds, same props and file — install one.
Install Folder
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Step 1 installs these for you. Run them yourself only if you are adding Folder to an existing project by hand. The cn helper and lucide-react are not listed — the installation guide covers them once for every component.
tooltip is a component, not a package — the shadcn CLI installs it as source files.
gsap is an npm package.
Examples
Fan on hover
Hover a card for its name. Use the arrows — or drag a card sideways — to page through; the window wraps at either end.
files- is the list peeking out. Without
thumbeach one renders as a unified skeleton card;nameshows in a tooltip while the fan is open. Past five, the fan pages.
Icon
Pick an icon — it and the pocket take their shades from the theme colour chosen at the top of the page.
icon- is any lucide icon component; it sits centred on the front pocket and is darkened from
colorby a fixed OKLCH amount, so it stays legible on light and dark bodies alike.
Photos
Drag a photo sideways — or swipe it with a thumb — to page through; the arrows do the same.
files- entries with a
thumbURL become photo cards — the picture is clipped to the card's rounded corners and fans out like the rest.
Features
One silhouette
The tab and body are a single rounded path, so the join never shows a notch and every corner — including the slant — is a true squircle.
Colour-derived shades
Pocket, icon and skeleton cards are computed from color in OKLCH, so any base colour — near-black included — stays readable.
Fits the room
The fan measures its nearest clipping ancestor and tightens the gap — then drops a card — rather than overflowing on a narrow screen.
Reachable everywhere
Hover opens it on desktop; a tap toggles it on touch; focus opens it from the keyboard. Every animation respects prefers-reduced-motion.
Best Practices & Guidelines
Leave headroom above the folder
The fan lifts cards roughly half the folder's height above it and the arrows sit just outside its width. Give the folder that space, and avoid overflow-hidden on its immediate parent.
Do not double up the click
An interactive folder spends its click on the file picker, so tap-to-toggle is off there. If an ancestor already handles clicks, pass toggleOnClick= and focusable so the fan stays keyboard-reachable.
Props Reference
<Folder> Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Title under the folder. |
count | string | — | Count / subtitle line. Falls back to "{n} items", or "Drop files or click" when interactive. |
color | string | tint of --primary | Folder body colour — any CSS colour. By default a pastel of the theme colour (FOLDER_THEME_TINT: lightness 0.88, chroma at 40%). Pocket, icon and skeleton cards derive their shades from it. |
icon | LucideIcon | — | A lucide icon component shown on the front pocket. |
files | FolderFile[] | — | { thumb?, name?, progress? } — photo, skeleton card, or both; name shows in a tooltip on hover. |
peek | number | 3 | Skeleton cards to show when no files are given. |
open | boolean | — | Force the fan open or closed. Omit to let hover, tap, focus and drag drive it. |
blur | number | 10 | Frosted-glass blur on the pocket, in px. |
size | number | 260 | Folder width in px. Height derives from it. |
progress | number | — | Overall upload progress 0–100 — drives the bar across the pocket while below 100. |
stickers | ReactNode | — | Extra decoration on the pocket (emoji, etc.) — sits under the icon. |
showLabel | boolean | true | Show the title. |
showCount | boolean | true | Show the count line. |
interactive | boolean | false | Enable drag-and-drop + click-to-browse. |
toggleOnClick | boolean | !interactive | Tap toggles the fan — the touch/keyboard path to the hover reveal. Turn off when an ancestor owns the click. |
focusable | boolean | false | Join the tab order and open the fan on focus without a tap toggling it — for when toggleOnClick is off. |
accept | string | — | Passed to the hidden file input. |
multiple | boolean | true | Allow picking several files at once. |
onFiles | (files: File[]) => void | — | Fires with dropped or selected files. |
onRemoveFile | (index: number) => void | — | Shows an × on each fanned card, reporting the file's index within files. |
className | string | — | Merged onto the root. |
SkeletonCard
thumb — reuse it anywhere you need a pretend file so the language stays consistent.