Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

PDFViewer

Read the bundled brand-guidelines document.

Preview

Live preview

Changes apply to this preview only.

This browser cannot display the PDF inline.

Open the PDFDownload the PDF

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Without the toolbar

The embed can stand alone when the page already provides its own heading and actions.

Open preview

CSS height

`height` accepts a number of pixels or any CSS length, so a document can follow the viewport.

Open preview

Custom fallback

When the browser cannot display PDFs inline, the children of the object take over. Replace the default copy with product-specific help.

Open preview

Usage

The viewer uses the browser PDF capability; keep a direct document link and useful fallback.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluPDFViewerLabels

Type source
PimoluPDFViewerLabels public API
NameTypeDefaultDescription
toolbarstring | undefined"PDF actions"Accessible name of the toolbar. Defaults to "PDF actions".
openInNewTabstring | undefined"Open in new tab"Defaults to "Open in new tab".
downloadstring | undefined"Download PDF"Defaults to "Download PDF".
fallbackstring | undefined—Shown inside the object fallback.
openPdfstring | undefined"Open the PDF"Fallback link label. Defaults to "Open the PDF".
downloadPdfstring | undefined"Download the PDF"Fallback download label. Defaults to "Download the PDF".
toolbar

string | undefined

Default: "PDF actions"

Accessible name of the toolbar. Defaults to "PDF actions".

openInNewTab

string | undefined

Default: "Open in new tab"

Defaults to "Open in new tab".

download

string | undefined

Default: "Download PDF"

Defaults to "Download PDF".

fallback

string | undefined

No default extracted.

Shown inside the object fallback.

openPdf

string | undefined

Default: "Open the PDF"

Fallback link label. Defaults to "Open the PDF".

downloadPdf

string | undefined

Default: "Download the PDF"

Fallback download label. Defaults to "Download the PDF".

PimoluPDFViewerProps

Type source
PimoluPDFViewerProps public API
NameTypeDefaultDescription
srcRequiredstring—URL of the PDF document.
titleRequiredstring—Required: names the document for assistive technology and the toolbar.
heightstring | number | undefined480Height of the viewer, as a number of pixels or any CSS length. Defaults to 480.
downloadableboolean | undefinedtrueShow a download action in the toolbar and in the fallback. Defaults to true.
openInNewTabboolean | undefinedtrueShow an "open in new tab" action in the toolbar. Defaults to true.
initialPagenumber | undefined—Page opened through the standard `#page=` PDF fragment. Browsers that support it (Chrome, Edge, Firefox, Safari) honor it; in-page navigation remains the browser's own viewer responsibility.
showToolbarboolean | undefinedtrueRender the toolbar. Defaults to true.
downloadFileNamestring | undefined—Suggested file name for the download link.
fallbackReactNode—Custom content used when the browser cannot embed the PDF.
labelsPimoluPDFViewerLabels | undefined—Localizable toolbar and fallback copy.
aria-labelstring | undefined`title`Accessible name of the embedded document. Defaults to `title`.
classNamestring | undefined—Class applied to the viewer wrapper.
onLoadReactEventHandler<HTMLObjectElement> | undefined—Called when the embedded document loads.
srcRequired

string

No default extracted.

URL of the PDF document.

titleRequired

string

No default extracted.

Required: names the document for assistive technology and the toolbar.

height

string | number | undefined

Default: 480

Height of the viewer, as a number of pixels or any CSS length. Defaults to 480.

downloadable

boolean | undefined

Default: true

Show a download action in the toolbar and in the fallback. Defaults to true.

openInNewTab

boolean | undefined

Default: true

Show an "open in new tab" action in the toolbar. Defaults to true.

initialPage

number | undefined

No default extracted.

Page opened through the standard `#page=` PDF fragment. Browsers that support it (Chrome, Edge, Firefox, Safari) honor it; in-page navigation remains the browser's own viewer responsibility.

showToolbar

boolean | undefined

Default: true

Render the toolbar. Defaults to true.

downloadFileName

string | undefined

No default extracted.

Suggested file name for the download link.

fallback

ReactNode

No default extracted.

Custom content used when the browser cannot embed the PDF.

labels

PimoluPDFViewerLabels | undefined

No default extracted.

Localizable toolbar and fallback copy.

aria-label

string | undefined

Default: `title`

Accessible name of the embedded document. Defaults to `title`.

className

string | undefined

No default extracted.

Class applied to the viewer wrapper.

onLoad

ReactEventHandler<HTMLObjectElement> | undefined

No default extracted.

Called when the embedded document loads.

Accessibility

  • Tag the source PDF accessibly and provide an HTML alternative for essential information.
Read the accessibility guide →