GitHub

FileViewerViewport

The document viewport boundary inside FileViewerInset.

FileViewerViewport is the scroll and clipping boundary for routed documents. It must live inside FileViewerInset, and FileViewerDocument must live inside it.

<FileViewerInset>
  <FileViewerViewport>
    <FileViewerDocument />
  </FileViewerViewport>
</FileViewerInset>

Behavior

  • Renders a data-slot="file-viewer-viewport" element.
  • Defines the scroll and clipping boundary that routed documents render inside.
  • Keeps animated width out of React measurement; document sizing comes from the FileViewer document-frame contract.
  • Throws in development when it is rendered outside FileViewerInset.
  • Renderer internals use the frame contract for deterministic document sizing; app composition should treat the viewport as an anatomy boundary.

API Reference

PropTypeDescription
childrenReact.ReactNodeUsually FileViewerDocument.
...propsReact.ComponentProps<"div">Standard viewport props; className is merged.

Source

file-viewer-layout.tsx