File manager comes with Pro. Its preview shows once you unlock it.
Usage
import { DashboardFiles } from './DashboardFiles.jsx'
// Without items the block shows its sample bakery drive. Wire it to yours:
<DashboardFiles
locale="en"
items={drive.items} // [{ id, name, type: 'folder' | 'pdf' | 'sheet' | 'doc' | 'image' | 'video' | 'archive' | 'design', size, at, parent }]
storage={drive.storage} // { total, used: { images, videos, documents, other } } in bytes
onOpen={(item) => item.type !== 'folder' && preview(item)}
onUpload={(file, progress) => drive.upload(file, { onProgress: progress })} // progress(0..1); resolve when stored
onDownload={(items) => drive.zip(items)}
onDelete={(items) => drive.remove(items.map((item) => item.id))}
loading={drive.loading}
error={drive.error}
onRetry={drive.reload}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text, the sample drive, sizes and dates. |
items | Array<{ id, name, type, size, at, parent }> | sample drive | Every folder and file; parent is the id of the folder it is in, or null at the top. size is in bytes. |
storage | { total, used: { images, videos, documents, other } } | sample plan | The plan’s space and what each type uses, in bytes. Uploads and deletions move it. |
view | 'grid' | 'list' | 'grid' | How the files show at first. |
onUpload | (file, progress) => Promise | — | A file was dropped or chosen. Call progress with 0 to 1; resolve when it is stored, reject to mark it failed. |
onOpen / onDownload / onDelete | (item) => void / (items) => Promise / (items) => Promise | — | An item was opened (folders also open in place), or the selection bar downloads or deletes the chosen items. |
now | Date | string | now | The date given to new uploads. |
loading | boolean | false | Shows the skeleton of the drive. |
error / onRetry | boolean | string / () => void | false | Shows the error banner with a retry button; a string replaces its sentence. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
className | string | — | Extra class on the root element. |
Add it to your project
Pro includes the full source of this block. Copy its prompt to install it with your coding agent.
DashboardFiles.jsxdashboard-files.csscopy.jskit.jsxkit.cssui/base-button/ui/category-bar/ui/empty-state/ui/alert-banner/ui/checkbox/ui/skeleton-shimmer/ui/breadcrumb/ui/segmented-control/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.
