Skip to main content

DirectoryList

Card-wrapped directory listing with loading, error, and empty states

DirectoryList

Card-wrapped directory listing with loading, error, and empty states

Source: packages/appkit-ui/src/react/file-browser/directory-list.tsx

Props

PropTypeRequiredDefaultDescription
entriesDirectoryEntry[]-Directory entries to display
loadingboolean-Whether the directory is currently loading
errorstring | null-Error message to display
onEntryClick(entry: DirectoryEntry) => void-Called when an entry is clicked
onNavigateToParent(() => void)-Called when the back/parent button is clicked
onRetry(() => void)-Called when the retry button is clicked
isAtRootboolean-Whether the user is at the root directory (hides back button)
selectedPathstring | null-Currently selected file path for highlighting
resolveEntryPath(entry: DirectoryEntry) => string-Resolves a DirectoryEntry to its full path
headerContentReactNode-Content rendered between the back button and the entry list (e.g., NewFolderInput)
hasCurrentPathboolean-Whether a current path is set (affects empty state message)
formatSize((bytes: number) => string)-Custom file size formatter
labelsPick<FileBrowserLabels, "backToParent" | "emptyDirectory" | "noVolumeConfigured" | "retry">-Customizable labels

Usage

import { DirectoryList } from '@databricks/appkit-ui';

<DirectoryList /* props */ />