FileTree

Displays a list of files and directories in a table, sorted with directories first.

Import

import { FileTree } from "@gumtree/ui/forge/FileTree";

Props

PropTypeDefaultDescription
entries*FileTreeEntry[]-Array of file/directory entries to display

Examples

Mixed Directories and Files

Directories are sorted before files, each with optional commit metadata.

srcrefactor: move utils2 days ago
teststest: add unit tests1 week ago
deno.jsonchore: update deps1 day ago
main.tsfeat: add server5 days ago
README.mddocs: update readme3 days ago
<FileTree entries={[
  { name: "src", type: "dir", lastCommitMessage: "refactor: move utils", lastCommitDate: "2 days ago" },
  { name: "tests", type: "dir", lastCommitMessage: "test: add unit tests", lastCommitDate: "1 week ago" },
  { name: "README.md", type: "file", lastCommitMessage: "docs: update readme", lastCommitDate: "3 days ago" },
  { name: "deno.json", type: "file", lastCommitMessage: "chore: update deps", lastCommitDate: "1 day ago" },
  { name: "main.ts", type: "file", lastCommitMessage: "feat: add server", lastCommitDate: "5 days ago" },
]} />