Calm motion: animations on this site only fade, with no movement
File browser
The files and folders of one folder as a grid or a list, with a path to go back
Shows the content of a folder in a file store or a shared drive. For the whole tree of folders in a side bar, use the file tree.
Basic
4 items
itemsis the content of the folder. Each item has anid, aname, and optionalfolder,sizein bytes, andmodifieddate.- Folders come first. Names sort in natural order, so "notes 9" comes before "notes 10".
v-model:viewisgridorlist. The grid shows a folder or a page with the file extension. The list is a table with the date and the size.- A click on an item emits
open. If it is a folder, show its content and add it topath. pathis the list of folders from the top to this one. A click on a folder in the path emitsnavigatewith its id.localeformats the sizes and the dates. The dates show in UTC, so the server and the browser agree.- Change the words with
labelsor a label pack. The API table lists the keys.
Usage
ts
import { BlessFileBrowser } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
items* | BlessFileItem[] | — | |
path | { id: string; label: string; }[] | [] | the folders from the top down to this one; the last is the current folder |
locale | string | "en" | |
labels | Partial<{ path: string; view: string; grid: string; list: string; name: string; modified: string; size: string; folder: string; empty: string; items: (n: number) => string; }> | — | |
view | "grid" | "list" | "grid" |
Events
| Name | Payload | Description |
|---|---|---|
open | [item: BlessFileItem] | |
update:view | [value: "grid" | "list"] | |
navigate | [id: string] |