Esc
Documentation
On this page

Props

PropTypeDefaultDescription
files requiredreadonly CodeExplorerFile[]NoneFile metadata, as { path, size? } with paths relative to the source root
pathstringNoneThe selected file or directory, relative to the source root
file requiredResourceReferenceNoneResource reference that reads one file. The component adds the selected path to its input.
basePath requiredstringNoneRelative host navigation prefix. Each path segment is URL encoded.
titlestringNoneTitle shown above the browser
versionstringNoneChanging it refetches the selected file
emptyMessagestringNoneText shown when there are no files

Example

ts
CodeExplorer({
  title: "Project source",
  files: [{ path: "src/index.ts", size: 120 }],
  path: params.path,
  basePath: "source/files",
  file: { resourceId: "source-file", input: { projectId } },
  version: snapshotVersion,
})

Supporting types

CodeExplorerFile
export interface CodeExplorerFile {
  path: string;
  size?: number;
}
CodeExplorerContent
export interface CodeExplorerContent {
  content?: string | null;
  size?: number;
  reason?: string | null;
  language?: string | null;
}

View the source on GitHub