Ballmac UI home

File Browser

A file manager for apps: breadcrumb folders, search, sortable columns, row checkboxes with select-all, a bulk-action bar, list and grid views and full keyboard control.

2 items
1 item
demo.mp4141 MB
Q3 report.pdf3.7 MB
README.md5.3 KB
release.zip50 MB

6 items

Installation

$ pnpm dlx shadcn@latest add @ballmac/file-browser

Usage

import { FileBrowser, formatSize } from "@/components/ballmac/file-browser"

The full example is in the Code tab above.

Examples

Grid view

6 items

API reference

PropTypeDefault
entries*

The top-level entries. Folders can hold more through `children`.

FileEntry[]—
rootLabel

Name of the top level in the breadcrumb.

string—
view

"list" is a sortable table, "grid" is a card grid.

"list" | "grid"—
onOpenFile

Called when a file is opened (double-click or Enter).

(file: FileEntry) => void—
onDelete

Adds a Delete button to the selection bar.

(ids: string[]) => void—
onDownload

Adds a Download button to the selection bar.

(ids: string[]) => void—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Arrow keysMove between rows or cards
SpaceToggles selection
EnterOpens a folder or file
Screen readersSort state, selection count and item count are announced

Use with AI

<FileBrowser entries rootLabel view onOpenFile onDelete onDownload />. entries is a FileEntry tree. Sort by name, modified or size (aria-sort). Space selects, Enter opens, arrow keys move. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI File Browser (@ballmac/file-browser) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Drive-style pages inside an app
  • Choosing files for download or deletion

Not for

  • A Mac-styled window (finder-window)
  • Plain tables (data-table)

Registry JSON: https://ui.ballmac.com/r/file-browser.json

Credits

Free to use in personal and commercial projects.