Tree view
A tree view draws a file tree: folders and files with icons, notes, badges and git status. Paste the output of tree or write the indentation yourself.
treeview files "my-app" [sort: folders, chevrons] {
src/
index.ts: entry point
components/ [collapsed]
Button.tsx
routes/
[id]/
page.tsx [added]
util.ts [modified]
legacy.js [deleted]
package.json
README.md [highlight]
diagram.yu # the source
}Indentation is the tree, and there may be several top-level entries. - bullets are optional, and so are the ├──, │ and |-- prefixes the tree command prints, so its output pastes as is (the N directories, M files line is skipped). An entry is a folder when it has children, ends in / or says [folder], and a ... entry stands for "more files". Files get an icon and a colour from their name: code, tests, scripts, documents, images, fonts, media, config, lockfiles, packages, git files and databases. Folders such as node_modules/, dist/ and .git/ get a grey one.
name: note or name # note adds a note. The props go at the end of the line, after a space, so a folder named [id] stays a name:
| entry prop | result |
|---|---|
| a colour | tints the icon and the name |
icon: folder | code | doc | image | … | another icon; any other text, like an emoji, is drawn as is |
badge: text | a pill after the name |
note: text | a note, like : text |
size: text | a right-aligned column, like 4 KB or 12 lines |
collapsed | a closed folder: its children are hidden |
highlight | a band behind the row |
dim | a faded row |
folder / file | forces the entry's type |
added, modified, deleted, renamed, ignored | git status: colours the name and adds a letter on the right |
The icon names are folder, folder-open, file, code, doc, image, config, lock, package, git, database, test, font, media, terminal and yuhwa.
Rules
match <glob> [props] gives every entry the glob matches the same props, so a tree can say once that tests are faded or that a folder starts closed. A rule may go anywhere in the body; the entry's own props win over a rule's.
| glob | matches |
|---|---|
*.test.ts | names; * and ? never cross a / |
src/**/*.ts | paths, when the glob has a /; ** crosses / |
*.{ts,tsx} | either ending |
docs/ | folders only, when the glob ends in / |
A rule that matches nothing gets a warning.
| header prop | result |
|---|---|
icons: color | mono | emoji | none | coloured icons (default), grey ones, emoji, none |
lines: solid | rounded | dashed | dotted | none | the guide lines; rounded curves the corner to the last child |
sort: none | name | folders | as written (default), by name, folders first |
notes: column | inline | notes in one aligned column (default) or after each name |
chevrons | a › before every folder |
rows: striped | every other row shaded |
spacing: compact | normal | relaxed | row height (not the same as compact) |
slashes: true | false | add or remove the / after folder names |
compact | a folder whose only child is a folder shares its row: a/b/c/; a folder with a note, badge, status or other prop stays on its own |
counts: collapsed | all | none | how many entries a folder holds: closed ones (default) |
marks: letter | dot | none | the git status column on the right, set by added, modified, … : letters M, A, D, R (default), dots, or none |
rollup: false | no dot on folders that hold changed files |
depth: 2 | show only the first levels; deeper folders show closed |
indent: 24 | the width of one level |
folder-color: teal | the folder icons (default amber) |
line-color, note-color | the guide lines, the notes |
highlight-color, badge-color | the default highlight band and badge pill |
strike-width: 2, strike-color: red | the line through deleted entries |
The panel props work as on every panel: radius, shadow, border, background and frame: false style the frame. edge-color and edge-width draw the guide lines (line-color wins over edge-color), and radius also rounds the highlight band. width makes the frame at least that wide; the notes, sizes and marks then line up at its right edge.
Examples
Rules, counts and sizes
treeview web "acme-web" [sort: folders, chevrons, compact, folder-color: teal] {
match *.test.ts [dim]
match docs/ [collapsed]
src/
main/
java/
App.java: entry point
components/
Button.tsx [added, size: 2.1 KB]
Button.test.ts [size: 1.4 KB]
Card.tsx [modified, size: 3.8 KB]
...
docs/
intro.md
guide.md
scripts/
deploy.sh
package.json
}Folders that hold changed files get a dot in the status column; closed folders show how many entries they hide.
Rounded lines and a styled frame
treeview src "src" [lines: rounded, compact, edge-color: teal, edge-width: 2, radius: 16, shadow] {
main/
java/
com/
acme/
App.java [highlight]
Router.java
test/
java/
AppTest.java
}compact puts main/java/com/acme/ and test/java/ on one row each.
Pasted tree output
The drawing characters and the summary line are skipped.
treeview out "tree" {
.
├── src
│ ├── main.go
│ └── handler.go
├── go.mod
└── README.md
1 directory, 4 files
}A pull request
Statuses colour the names and add a letter on the right.
treeview pr "feat: dark mode" [sort: folders] {
src/
theme/
dark.ts [added]
tokens.ts [modified]
old-colors.ts [deleted]
App.tsx [modified]
.env [ignored]
CHANGELOG.md [modified]
}A monorepo, explained
Notes line up in one column; badges mark what matters.
treeview repo "acme" [chevrons, rows: striped] {
apps/
web/: the Next.js site
admin/: internal tools [badge: beta]
packages/
ui/: shared components
config/: lint and tsconfig presets
docs/ [collapsed]
intro.md
pnpm-workspace.yaml
turbo.json: build pipeline
}Plain
No icons, dashed lines, compact rows.
theme: mono
treeview plain "layout" [icons: none, lines: dashed, spacing: compact] {
content/
posts/
hello.md
about.md
layouts/
base.html
config.toml
}Emoji and your own icons

Edittreeview fun "assets" [icons: emoji] {
images/
logo.svg
hero.png
fonts/ [icon: 🔤]
Inter.woff2
notes.txt [icon: 📝]
}