Developers · Gutenberg
File Tree block for WordPress
Display a visual file and folder tree structure — ideal for documentation, project overviews, and tutorials.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
Display a visual file and folder tree structure — ideal for documentation, project overviews, and tutorials.
Inspector panels on this block: Tree Settings, Files & Folders, Theme Colors, File Type Colors. Those titles come from index.js, not from a shared template.
Behavior controls: “Type” options: File, Folder; “Indent Level” options: Level 0 (root), Level 1, Level 2, Level 3, Level 4.
Where to find it
Gutenberg inserter → Developers → search “File Tree” (block name `blockenberg/file-tree` in block.json). Style it in the sidebar after insert.
How to use File Tree block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “File Tree”, insert it. Category: Developers.
- Configure inspector controls that exist on this block. Open Tree Settings. Set “Tree Settings — Title”, “Show Title”, “Show Icons”, “Show Indent Lines”.
- Check the published page. The view script reads HTML data attributes: data-opts, data-rendered. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Tree Settings — Title | Text field in the inspector. block.json default: Project Structure. Saved as `treeTitle`. |
| Show Title | On/off toggle in the inspector. On by default. Saved as `showTitle`. |
| Show Icons | On/off toggle in the inspector. On by default. Saved as `showIcons`. |
| Show Indent Lines | On/off toggle in the inspector. On by default. Saved as `showLines`. |
| Extension Colors | On/off toggle in the inspector. On by default. Saved as `showExtensionColors`. |
| Name | Text field in the inspector. Saved as `files`. |
| Type | Select control; the chosen value is saved on the block. Options: File; Folder. Saved as `files`. |
| Indent Level | Select control; the chosen value is saved on the block. Options: Level 0 (root); Level 1; Level 2; Level 3; Level 4; Level 5. Saved as `files`. |
| Show as Open | On/off toggle in the inspector. Saved as `files`. |
| Typography — Title | Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoTitle`. |
| Items | Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoItem`. |
| Border Radius | Numeric range control in the inspector. Range 0–24. block.json default: 10. Saved as `borderRadius`. |
| Theme Colors — Background | Color control in the inspector. block.json default: #0f172a. Saved as `bgColor`. |
| Header BG | Color control in the inspector. block.json default: #1e293b. Saved as `headerBg`. |
| Theme Colors — Border | Color control in the inspector. block.json default: #1e293b. Saved as `borderColor`. |
| Theme Colors — Title | Color control in the inspector. block.json default: #f8fafc. Saved as `titleColor`. |
| Folder Name | Color control in the inspector. block.json default: #60a5fa. Saved as `folderColor`. |
| Folder Icon | Color control in the inspector. block.json default: #fbbf24. Saved as `folderIconColor`. |
| File Name | Color control in the inspector. block.json default: #cbd5e1. Saved as `fileColor`. |
| Indent Lines | Color control in the inspector. block.json default: #334155. Saved as `lineColor`. |
| Dot Red | Color control in the inspector. block.json default: #ef4444. Saved as `dotRed`. |
| Dot Yellow | Color control in the inspector. block.json default: #f59e0b. Saved as `dotYellow`. |
| Dot Green | Color control in the inspector. block.json default: #22c55e. Saved as `dotGreen`. |
| .js / .jsx | Color control in the inspector. block.json default: #f59e0b. Saved as `jsColor`. |
| .ts / .tsx | Color control in the inspector. block.json default: #3b82f6. Saved as `tsColor`. |
| .css / .scss | Color control in the inspector. block.json default: #a78bfa. Saved as `cssColor`. |
| .html | Color control in the inspector. block.json default: #f97316. Saved as `htmlColor`. |
| .json | Color control in the inspector. block.json default: #6ee7b7. Saved as `jsonColor`. |
| .md / .mdx | Color control in the inspector. block.json default: #94a3b8. Saved as `mdColor`. |
| .py | Color control in the inspector. block.json default: #4ade80. Saved as `pyColor`. |
| Images | Color control in the inspector. block.json default: #fb7185. Saved as `imgColor`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-opts, data-rendered.
When this is the right block
- Display a visual file and folder tree structure — ideal for documentation, project overviews, and tutorials — that is the job of File Tree, not a generic content block.
- Use it when you need the editor control labeled “Tree Settings — Title”, which exists on this block’s inspector.
- It matches pages about file, tree, folder.
- Inserter grouping: docs sites, utilities, and developer landing pages.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the File Tree block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “File Tree”. It sits under Developers. After insert, open Tree Settings and set “Tree Settings — Title”, “Show Title”, “Show Icons”, “Show Indent Lines”.
What makes File Tree different from other Blockenberg blocks?
Display a visual file and folder tree structure — ideal for documentation, project overviews, and tutorials. Inspector labels on this block include “Tree Settings — Title”, “Show Title”, “Show Icons”, “Show Indent Lines”.
Is the File Tree Gutenberg block free?
Yes. File Tree ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style File Tree to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Tree Settings, Files & Folders, Theme Colors, File Type Colors).
Related developers blocks
API Reference
Display API endpoint documentation with method badge, parameters table, and request/response code examples.
Clipboard Copy
Display a copyable code, coupon, or text with a one-click copy button.
Code Block
Syntax-highlighted code block with copy button, line numbers, and multiple themes.
Code Comparison
Side-by-side code comparison block with syntax highlighting, diff markers, labeled panels, copy buttons, line numbers, and a draggable split divider.
Code Playground
Interactive HTML/CSS/JS editor with live preview. Let visitors experiment with code directly on the page.
Code Tabs
Multi-language tabbed code viewer with syntax highlighting. Show the same snippet in JavaScript, Python, PHP, and more.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert File Tree from the Gutenberg inserter.