Ir al contenido
Español
Carpeta de archivos viene con Pro. La vista previa aparece al desbloquearlo.

Cómo funciona

The tile is one button. Its drawing sits in a box that already reserves the headroom the fan needs, so the tile never changes size and never covers what is above it. A darker back panel with a sloped tab, up to three white sheets and a front flap in the folder colour are stacked spans. When the folder opens, the sheets rise and spread to the sides by about an eighth of the folder's width, turning −12°, −1° and 10°, each 45ms after the one behind it on a 560ms spring; the front flap tips forward with rotateX(−28°) under perspective, a sheen brightens on it, and the shadow underneath widens and fades a little. Leaving lets everything settle back together in 380ms.

Úsalo para

  • Folder grids in a file manager, a shared drive or an attachments panel.
  • Collections that hold mixed documents: receipts, contracts, photo sets.
  • A drop target: pin open while a file is dragged over it.

Busca otra opción cuando

  • Long lists of folders where names and dates matter more: use a list or a table.
  • A single file: show its own thumbnail.
  • Dense toolbars or sidebars where a 150px tile does not fit.

Uso

import { FileFolder } from './FileFolder.jsx'

export function SharedFolders({ folders, navigate }) {
  return (
    <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
      {folders.map((f) => (
        <FileFolder
          key={f.id}
          name={f.name}
          count={f.fileCount}
          size={f.sizeLabel}
          tone={f.colour}
          previews={['doc', 'image', 'table']}
          open={f.id === dragOverId}
          onOpen={() => navigate(`/files/${f.id}`)}
        />
      ))}
    </div>
  )
}

Propiedades

PropiedadTipoPor defectoQué hace
namestring—Folder name, shown under the drawing and used in the button's accessible name.
countnumber—Number of files, written through labels.files.
sizestring—Total size, already formatted (for example '3.1 MB').
previews('doc' | 'image' | 'table' | 'receipt' | ReactNode)[]['doc', 'image', 'table']Up to three sheets, back to front. A keyword draws tiny placeholder content; an element (a real thumbnail, say) fills the sheet instead.
tone1–81Chart colour of the folder; the back panel is a darker shade of it.
openbooleanfalsePins the fanned state, for example while the folder is selected or a file is dragged over it.
onOpen(event) => void—Called on click, tap, Enter or Space.
folderSize'sm' | 'md' | 'lg''md'Width of the drawing: 120, 150 or 200px.
labelsobject—Replaces built-in text: files(n) for the count, open(name) for the accessible name. Shallow-merged over the English defaults.
...restButtonHTMLAttributes—Other attributes go to the root <button>.

Accesibilidad

  • The tile is a native button named by labels.open(name) plus the count and size; the drawing is aria-hidden.
  • Keyboard focus fans the sheets the same way hover does and shows a focus ring; Enter or Space opens.
  • On touch, holding a finger on the folder fans it out, and lifting it opens; the system long-press menu is suppressed only while it is fanned.
  • Name and details are at least 13px, and long names end in an ellipsis.
  • Reduced motion lifts the sheets straight up a little at once, with no turning, spring, stagger or tipping flap.

Movimiento

Fan out: sheets 560ms spring with a slight overshoot, 45ms apart from the back; front flap rotateX(−28°) 560ms spring; shadow widens 10% and fades to 70%. Settle: everything 380ms ease-out together. Press: the drawing scales to 97% in 100ms.

Añádelo a tu proyecto

Los miembros Pro copian un prompt y su agente de programación instala el código, igual que con los gratuitos.

FileFolder.jsxfile-folder.csstokens.cssREADME.md

Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.

Tarjetas
Tarjeta con borde animado viene con Pro. La vista previa aparece al desbloquearlo.
Borde con haz de luz viene con Pro. La vista previa aparece al desbloquearlo.
Tarjeta con hoja de datos viene con Pro. La vista previa aparece al desbloquearlo.