GitHub

FileViewerControls

The renderer-registered operational controls in the File Viewer header.

FileViewerControls renders controls registered by the active renderer: page or slide position, zoom, rotate, loading state, downloads, and extra actions.

<FileViewerControls extra={<ApproveButton />} />

Behavior

  • Reads registered controls from file viewer context. The header stays file-type agnostic.
  • Falls back to the original file download action when the active renderer has not registered its own downloads.
  • Allows workflow actions through extra; this is merged with any renderer-registered extra.
  • Renders data-slot="file-viewer-controls" and data-file-viewer-controls="ready" when a renderer has registered controls.
  • Does not render file identity. Use FileViewerTitle for the file name and FileViewerMeta for passive metadata.

API Reference

PropTypeDescription
extraReact.ReactNodeFile-scoped actions beside renderer controls.
...propsViewerControls props except registered stateStandard controls props; className is merged.

Source

file-viewer-header.tsx