A folder's folders and files as a grid or a list: breadcrumbs, search, preview, upload with progress, new folder, rename, move, trash and a selection with the bulk action bar. Your app keeps the files and does the uploads; the component shows them and asks.
items are the current folder's contents (kind: "folder" or a file kind; without it the kind comes from mime or the extension). path is the breadcrumb trail; onNavigate(id) opens a folder or a crumb (crumbs with href are links, with linkAs for your router).
A file with an image or PDF preview URL opens in a drawer; onOpen(item) gets every file. The kit loads only the URLs you give it.
onUpload(files) adds Upload and accepts dropped files. Pass uploads with progress (and part / parts for large files uploaded in pieces) to show each file's state; onCancelUpload adds a stop button.
onCreateFolder, onRename (in place, also F2), onMove with a folders tree (a picker dialog), onTrash (after a confirmation) and onDownload. Each may return a Promise.
Keyboard: arrow keys move between items, Enter opens, Space selects, F2 renames, Delete trashes, ⌘/Ctrl+A selects all, Escape clears the selection.
view, selected, query and preview work controlled or uncontrolled. Below 560px the toolbar wraps, the grid gets two columns and the list shows size and date under the name.
launch-video.mp4184 MB · Part 7 of 18 · 38%
Files
Props
FileBrowser
Prop
Type
Notes
surface?
Surface
`"glass"` for a translucent surface over a map, photo or video; `"solid"` opts out inside a glass provider.
items
FileBrowserItem[]
The current folder's folders and files.
path?
{ id: string; name: string; href?: string }[]
Breadcrumbs from the root to the current folder (`href` makes them links).
onNavigate?
(folderId: string) => void
A folder or a breadcrumb was opened.
onOpen?
(item: FileBrowserItem) => void
A file was opened (files with an image or PDF `preview` also open the preview drawer).
previewOnOpen?
boolean
Set `false` to open files only through `onOpen`.
linkAs?
ElementType
Router link for breadcrumbs and "Open" (default `a`, or the provider's `linkAs`).
view?
"grid" | "list"
defaultView?
"grid" | "list"
onViewChange?
(view: "grid" | "list") => void
selected?
string[]
defaultSelected?
string[]
onSelectedChange?
(ids: string[]) => void
query?
string
defaultQuery?
string
onQueryChange?
(query: string) => void
localSearch?
boolean
Filters `items` by name as you type (default); `false` when your server searches.
search?
boolean
`false` hides the search field.
searchPlaceholder?
string
preview?
string | null
The id of the file shown in the preview drawer.
defaultPreview?
string | null
onPreviewChange?
(id: string | null) => void
onUpload?
(files: File[]) => void
Shows Upload and accepts dropped files; upload them yourself and pass `uploads`.