FileTree

Fiddle
A read-only, inline file tree that shows where files live.

Usage

The import, then a use to start from. Both copy as they are.

Import
import { FileTree } from "@/components/ui/FileTree";
Example
<FileTree    label="Fern project files"    items={[        {            kind: "folder",            name: "fern",            children: [                { kind: "file", name: "sdk-config.yml", note: "Tool settings", highlight: true },                { kind: "folder", name: "custom", children: [{ kind: "file", name: "hooks.ts", note: "Hooks", highlight: true }] }            ]        }    ]}/>

When to use

Use it for

  • Show where files live, inline and in context: a setup dialog or a hint that says which files to edit.
  • highlight the files the reader acts on; the rest stay muted. note says what a file holds, in a word or two.
  • Collapse a folder that holds one file into its row (tools/<name>.ts) to keep the tree short.

Avoid

  • Picking or opening files, or acting on them: that's the editor's file tree.
  • A long or full listing. Show the few files that matter.

Accessibility

Checks

  • It is a labelled list of lists (label), so screen readers announce the nesting.
  • Nothing in it is focusable or clickable; highlight is never the only cue, since the files are named.

API

Read from each component's stories, the same source as COMPONENTS.md, and kept in step by check:design-system.

FileTree

Its stories don't declare argTypes, so no props are listed. The variants show its states.
Also exportsSubItemConnector
VariantsDefaultWithoutNotesEmptyFolder

Keep going