Sections
File Viewer
- Overview
- Anatomy
- Header
- Navigation
- Renderers
FileViewerContent owns the space below FileViewerHeader. It is the boundary
between optional file-scoped navigation and the main file inset.
<FileViewerContent>
<FileViewerSidebar aria-label="PDF pages" />
<FileViewerInset>
<FileViewerViewport>
<FileViewerDocument />
</FileViewerViewport>
</FileViewerInset>
</FileViewerContent>FileViewerContent can also hold an inset alone, with no sidebar:
<FileViewerContent>
<FileViewerInset>
<FileViewerViewport>
<FileViewerDocument />
</FileViewerViewport>
</FileViewerInset>
</FileViewerContent>Behavior
- Renders a
data-slot="file-viewer-content"row that fills the remaining height below the header and lays out the sidebar beside the inset. - It is purely structural: it does not know whether the sidebar contains
thumbnails, attachments, segments, or source fields, and it does not own
sidebar open/collapse state — that lives on
FileViewerProvider. - Sidebar placement (side, width, inline vs. overlay) is resolved from
FileViewerand theFileViewerSidebarinside the content row.
API Reference
| Prop | Type | Description |
|---|---|---|
children | React.ReactNode | Typically a FileViewerSidebar and a FileViewerInset. |
...props | React.ComponentProps<"div"> | Standard content props; className is forwarded. |
Source
file-viewer.tsx
"use client";
export type { ViewerSource } from "./file-viewer-core";
export {
FileViewerContent,
FileViewerInset,
FileViewerLegend,
FileViewerViewport,
type FileViewerContentProps,
type FileViewerInsetProps,
type FileViewerLegendProps,
type FileViewerViewportProps,