Skip to content
↑↓ to navigate↵ to openesc to close

Menu

File Tree

Preview

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/file-tree

Import the shared styles once in your application.

TSUsage
import FileTree from '@/components/beui/layout/FileTree.vue'
import '@/components/beui/styles.css'

API Reference

FileTreeFolder

value
string
Default—
name
string
Default—
#icon?
slot

Icon of the row; replaces the default folder icon.

Default—
disabled?
boolean
Default—
class?
string
Default—
#default?
slot

The folder's children: `FileTreeFolder` and `FileTreeFile` parts.

Default—

FileTreeFile

value
string
Default—
name
string
Default—
#icon?
slot

Icon of the row; replaces the default file icon.

Default—
disabled?
boolean
Default—
class?
string
Default—

FileTree

v-model?
string | null

Selected id (`v-model`).

Defaultundefined
defaultValue?
string | null
Defaultnull
v-model:expandedIds?
string[]

Expanded folder ids (`v-model:expanded-ids`).

Defaultundefined
defaultExpandedIds?
string[]
Default[]
@update:expanded?
(ids: string[]) => void
Default—
ariaLabel?
string

Accessible name of the tree.

Default—
labels?
Partial<FileTreeMessages>

Override any built-in string.

Default—
indent?
number

Indent per level in px.

Default18
className?
string
Default—
classNames?
{ tree?: string; item?: string; icon?: string; label?: string }
Default—
items?
readonly FileTreeNode[]

Data-driven tree. Omit to compose `FileTreeFolder` and `FileTreeFile` in the default slot.

Default—
v-model:expanded?
string[]

Same as `expandedIds`, bound with `v-model:expanded`.

Defaultundefined
label?
string

Same as `ariaLabel`.

Default—
@value-change?
(id: string) => void
Default—
@expanded-change?
(ids: string[]) => void
Default—
#default?
slot
Default—
#item?
slot
Default—

Updated