DocsSupportPricing
Roadmap (has updates coming soon)XFigma3.7K
Sign inGet All-Access
  1. Components
  2. Tree
  3. Tree File Explorer
DocsMarkdownShare

Shadcn Tree File Explorer

File explorer tree with type icons. Built with the Tree component. Uses @headless-tree/core, @headless-tree/react alongside the shadcn primitives. A free, open source shadcn tree example you can install with npx shadcn@latest add @reui/c-tree-5 and edit as your own code.

File explorer tree with type icons

For AI Agents

Hand your agent this brief or the ReUI MCP, not a screenshot. Free to install.

Best for: A code project outline with a colored glyph per file type: amber folders, blue code files, purple stylesheets and yellow JSON

When to use

  • Folder and file explorers for a code project, a workspace or a document store
  • Record hierarchies such as CRM accounts and contacts, or an org chart of who reports to whom
  • Role permission editors grouped by area, where each action is ticked on or off

When not to use

  • Folder and file glyphs in one muted color, with guide lines between levels: use the Tree Folder File Icons example
  • A whole drive page with a folder rail beside a listing of the open folder: use the Files blocks
  • Folder rows with size and item count columns that move into other folders by pointer: use the Drag & Drop blocks
  • A pick of one value from a nested list, made inside a popup: use the Cascader component

Agent notes

  • getFileIcon maps each type to a glyph and color; a type it does not list, such as config, falls back to a plain file glyph
  • Folder rows come from isItemFolder counting children, not from type, so an empty folder record renders as a leaf
  • syncDataLoaderFeature throws when getItem returns nothing or a promise, so children fetched from a server need the async data loader feature
  • The rootItemId record is never drawn, so its children form the top level and its own name stays hidden
  • After adding, moving or removing records behind dataLoader, call rebuildTree on tree, or the rows keep the old structure

Third-party API docs

  • Headless Tree v1: API reference, docs
Markdownhttps://reui.io/components/tree/c-tree-5.md
MCPget_example("c-tree-5")
Installnpx shadcn@latest add @reui/c-tree-5
Full index for agents:llms.txtReUI MCP setup

Shadcn Components in Tree File Explorer

  • Tree

Dependencies

  • @headless-tree/core
  • @headless-tree/react

About Shadcn Tree File Explorer

File explorer tree with type icons. Built with the Tree component. Uses @headless-tree/core, @headless-tree/react alongside the shadcn primitives. A free, open source shadcn tree example you can install with npx shadcn@latest add @reui/c-tree-5 and edit as your own code.

What You Can Build With Shadcn Tree File Explorer

  • Composes Tree, so it drops into any project already using those components.
  • Install it with the shadcn CLI: npx shadcn@latest add @reui/c-tree-5
  • Open source and free, with the full source on this page to copy or adapt.

More Shadcn Tree Examples

  • Basic Basic tree.
  • Indent Lines Tree with indented lines.
  • Folder File Icons Tree with custom indent.
  • Plus Minus Toggles Tree with custom indent.
  • Org Chart Organization chart tree with avatars
  • Permissions Permissions tree with checkboxes

Related Shadcn Component Categories

  • Accordion

    Open-source shadcn accordion components for FAQ layouts, settings panels, and help sections.

  • Alert

    Open-source shadcn alert components for status messages, warning banners, and destructive notices.

  • Alert Dialog

    Open-source shadcn alert dialog components for delete confirmations, destructive actions, and critical decisions.

  • Aspect Ratio

    Open-source shadcn aspect ratio components for responsive media, image galleries, and video previews.

  • Attachment

    Open-source shadcn attachment components for chat composers, upload states, and file previews.

  • Autocomplete

    Open-source shadcn autocomplete components for smart search, typeahead inputs, and suggestion lists.

Frequently Asked Questions

When should I use Shadcn Tree File Explorer?

Use it for a code project outline with a colored glyph per file type: amber folders, blue code files, purple stylesheets and yellow JSON.

Shadcn Tree as a whole fits:

  • Folder and file explorers for a code project, a workspace or a document store
  • Record hierarchies such as CRM accounts and contacts, or an org chart of who reports to whom
  • Role permission editors grouped by area, where each action is ticked on or off

For folder and file glyphs in one muted color, with guide lines between levels, use the Tree Folder File Icons example. For a whole drive page with a folder rail beside a listing of the open folder, use the Files blocks. For folder rows with size and item count columns that move into other folders by pointer, use the Drag & Drop blocks. For a pick of one value from a nested list, made inside a popup, use the Cascader component.

How do I install Shadcn Tree File Explorer?

Run npx shadcn@latest add @reui/c-tree-5. The CLI copies the source into your project, so you own the code and can edit it freely.

Is Shadcn Tree File Explorer free to use?

Yes. Every ReUI component example is open source and free for personal and commercial projects.

Which components does Shadcn Tree File Explorer use?

It composes Tree. The shadcn CLI installs those alongside the example.
PreviousPlus Minus TogglesNextOrg Chart

Start building with ReUI Pro today.

Every Pro block, every style, and every future addition, with one license for unlimited projects.

Get All-Access

From $249, once. Lifetime updates.

Application

  • App ShellAdded 4 new App Shell blocks
  • Auth
  • Card
  • Dashboard
  • Dialog
  • Empty State
  • Event Calendar
  • Flow
  • Form
  • Gantt
  • Kanban Board
  • List
  • Navbar
  • Onboarding
  • Profile
  • Rich Text Editor
  • Schedule
  • Settings
  • Sheet
  • Stats
  • Timeline
  • Whiteboard
  • Wizard

Data Grid

  • Base
  • AdvancedNew Advanced category with 3 Data Grid blocks
  • Columns
  • Drag & Drop
  • Editing
  • Expansion
  • Filtering
  • Grouping
  • Virtualization

Charts

  • Area Chart
  • Bar Chart
  • Composed Chart
  • Line Chart
  • Pie Chart
  • Radial Chart
  • Sparkline
  • Status Tracker

AI & Agents

  • AI Chat
  • Agent Activity

Solutions

  • Dev Ops
  • AI Ops
  • CRM
  • Agents
  • Analytics
  • Billing
  • Bookings
  • Files
  • Inventory
  • Users

Templates

  • E-commerce
  • SaaS
  • Dashboard
  • Landing
  • All templates

eCommerce

  • Category Card
  • Checkout
  • Comparison
  • Coupon
  • Filter Sidebar
  • Product Card
  • Product Detail
  • Product Grid
  • Receipt
  • Review
  • Shopping Cart
  • Wishlist
  • Shop Hero

Marketing

  • Blog
  • Compare
  • Contact
  • CTA
  • FAQ
  • Hero
  • How It Works
  • Pricing

Resources

  • Components
  • Blocks
  • Icons
  • MCP for Agents
  • Docs
  • Support
  • Pricing
  • Tailwind Plus Alternative
  • Roadmap(has updates coming soon)
  • AffiliateSoon

Legal

  • Privacy Policy
  • Terms & Conditions
  • License
  • Refunds
  • Cookies

© 2026 ReUI. All rights reserved.

3.7K