Use docspress/file-tree to show the relevant part of a repository or directory hierarchy. Two-space indentation defines depth, and a trailing / identifies a folder.
When to use it
Choose File Tree when location and nesting are part of the lesson. Use Fields / Schema for structured properties and Diagram for relationships among systems. Omit files that do not help the current task.
Write tree source
Use two spaces for each depth:
docs/
index.md
guides/
publishing.md
package.json
Tabs normalize to two spaces. Nesting is capped at 12 levels. A label ending in / is a folder; other labels are files.
Attributes
File Tree attributes
docspress/file-tree.-
rootstring -
Plain-text label above the tree.
-
treestring required -
Indentation-aware hierarchy with two spaces per depth and trailing slashes for folders.
-
captionstring -
Optional formatted explanation.
-
collapsibleboolean -
Uses native folder disclosures when a folder has children.
-
openboolean -
Initial state of collapsible folders.
No fields match this filter.
Creative examples
Focused documentation tree
-
docs/-
index.md -
guides/-
continuous-sync.md
-
-
-
package.json
Collapsed monorepo map
-
apps/-
docs-site/-
package.json
-
-
admin/-
package.json
-
-
-
packages/-
blocks/-
src/
-
-
sync-client/-
src/
-
-
-
pnpm-workspace.yaml
Generated plugin package
-
blocks/-
api-request/-
block.php -
editor.js -
style.css -
view.js
-
-
-
assets/-
code.css
-
-
includes/-
code-surface.php
-
-
docspress-blocks.php -
readme.txt
Published behavior and accessibility
The tree uses nested semantic lists. Collapsible folders with children use native disclosure controls and honor the authored initial state. The figure receives an accessible file-tree label.
Keep the sample shallow and task-specific. If readers need to copy file contents, follow the tree with Colorful Code examples rather than placing content in the hierarchy.