FolderTile
Animated folder button showing a fanned preview of up to three materials, an
opening flap, selected styling, and an optional hover action slot.
Visual state is derived from materials unless state is set; the folder
leans open on hover (openOnHover) or when forced open as a drop target
(open). All motion collapses to instant under reduced-motion preferences.
Usage
import { FolderTile, FolderTileEditIcon, FolderTileImageProps, FolderTileMaterial, FolderTileProps, FolderTileState } from "@desk/ui/components/folder-tile";Best practices
Only the first three
materialsrender in the fan; passitemCountwhen the real total differs, otherwise the count showsmaterials.length.Supply
renderImagein Next.js so previews go throughnext/image— the default renders plain<img>from each material'ssrc/alt.Drive drag-and-drop drop-target styling with
open(forces the open look without revealing the action); useselected+showSelectedStatefor selection, not manual classes.FolderTileis itself the button — passname/onClickand button props directly; don't wrap it in another<button>/<a>.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| action | ReactNode | Hover action rendered over the artwork, typically an edit/menu button. | |
| actionVisible | boolean | Keeps the action and open visual state visible while an external menu/popover is open. | |
| animateEmptyIcon | boolean | Whether the empty-folder plus icon rotates on hover. | |
| className | string | ||
| itemCount | number | Count displayed after the folder name. Defaults to | |
| materials | FolderTileMaterial[] | Material previews. The component renders at most the first three. | |
| name | string | Folder label. | |
| open | boolean | Forces the open visual state regardless of hover — e.g. while a draggable item hovers over the folder as a drop target. Does not reveal the action. | |
| openOnHover | boolean | Whether filled folders transition into the open state on hover. | |
| renderImage | (props: FolderTileImageProps) => ReactNode | Custom image renderer for frameworks such as Next.js. | |
| selected | boolean | ||
| showSelectedState | boolean | Whether selected styling is rendered when | |
| state | FolderTileState | Explicit visual state. When omitted, derived from material count. | |
| testId | string |
Also exports
- component
FolderTileEditIcon - type
FolderTileImageProps - interface
FolderTileMaterial - interface
FolderTileProps - type
FolderTileState
Composition
Builds on