318

Document Viewer Sidebar

Shared responsive thumbnail sidebar behavior for PDF, DOCX, and other document viewers.

Document Viewer Sidebar provides the responsive shell used by document viewers to show thumbnail navigation inline on wider layouts and as an overlay on narrower layouts.

Page 1 of 4
Page 1: Invoice summary

Installation

pnpm dlx shadcn@latest add @extend/document-viewer-sidebar

API Reference

DocumentViewerThumbnailSidebar

The DocumentViewerThumbnailSidebar component renders a responsive sidebar container for document thumbnails.

PropTypeDefaultRequired
childrenReact.ReactNode-Yes
classNamestring-No
inlineboolean-Yes
openboolean-Yes

DocumentViewerSidebarSkeleton

The DocumentViewerSidebarSkeleton component renders the sidebar loading state used while document thumbnails are not ready.

PropTypeDefaultRequired
inlineboolean-Yes

useElementWidth

The useElementWidth hook returns a ref and measured width for responsive viewer layout decisions.

useInlineThumbnailSidebar

The useInlineThumbnailSidebar hook returns whether the sidebar should render inline for a measured viewer width.