Skip to main content

FilePreviewPanel

Preview panel displaying file metadata, image/text preview, and download/delete actions

FilePreviewPanel

Preview panel displaying file metadata, image/text preview, and download/delete actions

Source: packages/appkit-ui/src/react/file-browser/file-preview-panel.tsx

Props

PropTypeRequiredDefaultDescription
selectedFilestring | null-Full path of the selected file (null when nothing is selected)
previewFilePreview | null-Preview data for the selected file
previewLoadingboolean-Whether the preview is loading
onDownload((filePath: string) => void)-Called when the download button is clicked
onDelete((filePath: string) => void)-Called when the delete button is clicked
deletingboolean-Whether a delete operation is in progress
imagePreviewSrcstring | ((filePath: string) => string)-Image preview source — string URL or function that receives the file path
formatSize((bytes: number) => string)-Custom file size formatter (defaults to formatFileSize)
labelsPick<FileBrowserLabels, "type" | "download" | "size" | "selectFilePrompt" | "previewNotAvailable" | "previewFailed" | "modified" | "unknown">-Customizable labels

Usage

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

<FilePreviewPanel /* props */ />