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.

Get Blockenberg

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

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “File Tree”, insert it. Category: Developers.
  3. Configure inspector controls that exist on this block. Open Tree Settings. Set “Tree Settings — Title”, “Show Title”, “Show Icons”, “Show Indent Lines”.
  4. 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

ControlWhat the code does
Tree Settings — TitleText field in the inspector. block.json default: Project Structure. Saved as `treeTitle`.
Show TitleOn/off toggle in the inspector. On by default. Saved as `showTitle`.
Show IconsOn/off toggle in the inspector. On by default. Saved as `showIcons`.
Show Indent LinesOn/off toggle in the inspector. On by default. Saved as `showLines`.
Extension ColorsOn/off toggle in the inspector. On by default. Saved as `showExtensionColors`.
NameText field in the inspector. Saved as `files`.
TypeSelect control; the chosen value is saved on the block. Options: File; Folder. Saved as `files`.
Indent LevelSelect 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 OpenOn/off toggle in the inspector. Saved as `files`.
Typography — TitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoTitle`.
ItemsShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoItem`.
Border RadiusNumeric range control in the inspector. Range 0–24. block.json default: 10. Saved as `borderRadius`.
Theme Colors — BackgroundColor control in the inspector. block.json default: #0f172a. Saved as `bgColor`.
Header BGColor control in the inspector. block.json default: #1e293b. Saved as `headerBg`.
Theme Colors — BorderColor control in the inspector. block.json default: #1e293b. Saved as `borderColor`.
Theme Colors — TitleColor control in the inspector. block.json default: #f8fafc. Saved as `titleColor`.
Folder NameColor control in the inspector. block.json default: #60a5fa. Saved as `folderColor`.
Folder IconColor control in the inspector. block.json default: #fbbf24. Saved as `folderIconColor`.
File NameColor control in the inspector. block.json default: #cbd5e1. Saved as `fileColor`.
Indent LinesColor control in the inspector. block.json default: #334155. Saved as `lineColor`.
Dot RedColor control in the inspector. block.json default: #ef4444. Saved as `dotRed`.
Dot YellowColor control in the inspector. block.json default: #f59e0b. Saved as `dotYellow`.
Dot GreenColor control in the inspector. block.json default: #22c55e. Saved as `dotGreen`.
.js / .jsxColor control in the inspector. block.json default: #f59e0b. Saved as `jsColor`.
.ts / .tsxColor control in the inspector. block.json default: #3b82f6. Saved as `tsColor`.
.css / .scssColor control in the inspector. block.json default: #a78bfa. Saved as `cssColor`.
.htmlColor control in the inspector. block.json default: #f97316. Saved as `htmlColor`.
.jsonColor control in the inspector. block.json default: #6ee7b7. Saved as `jsonColor`.
.md / .mdxColor control in the inspector. block.json default: #94a3b8. Saved as `mdColor`.
.pyColor control in the inspector. block.json default: #4ade80. Saved as `pyColor`.
ImagesColor control in the inspector. block.json default: #fb7185. Saved as `imgColor`.

What the front-end script actually does

When this is the right block

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

Get Blockenberg

Install Blockenberg from WordPress.org, then insert File Tree from the Gutenberg inserter.

Get Blockenberg