File Tree
Show project and directory structure as a tree.
Sketch a folder layout so the reader sees where a file goes. Indentation and folder icons carry the structure, no ASCII art to keep aligned by hand.
- src
- routes
- docs
- +layout.svelte
- introduction/+page.md
- docs
- app.css
- routes
- vite.config.ts
- package.json
Usage
Nest FileTreeItems to nest directories; an item with children is a folder
automatically. Pass folder to style an empty directory, and highlight to
call out the entry a guide is about to touch.
API reference
FileTree
FileTree
children required Snippet The top-level
FileTreeItem entries.FileTreeItem
FileTreeItem
name required string File or directory name.
folder boolean default falseForce folder styling for an empty directory. Folders with children are
detected automatically.
highlight boolean default falseEmphasize the entry, such as the file a guide is about to create.
children Snippet Nested entries. Their presence marks this item as a folder.