Skip to content
React PDF Viewer

Search

How to customize

Choose the right way to change how the viewer looks and behaves, from a CSS variable to a completely custom interface.

React PDF Viewer is customized in layers. Start with the lightest mechanism that achieves your goal; each step down gives more control and more responsibility.

Ways to customize

You want to…UseWhere
Match your brand colors, radius, spacing and fontsCSS variablesTheming
Support dark moderpv-theme-dark or rpv-theme-auto classesTheming
Style a state, such as loading or fullscreendata-* attributes on the rootTheming
Change or translate texts and accessible nameslabels and localeLabels and locale
Choose, place or hide toolbar controlstoolbar configToolbar
Replace the loading, empty, error or password viewsrender* propsOverriding structure
Replace the toolbar, or mix it with your own buttonsrenderToolbar and PdfToolbarCustom toolbar
Build a completely different interfaceusePdfDocument and PdfPageCanvasHeadless

How the styles are built

The stylesheet is plain CSS in a cascade layer named rpv, with every class prefixed rpv-. Because it is layered, any unlayered CSS in your app wins without !important. Every color and size reads a CSS variable with a fallback, so setting a variable on the viewer or on any ancestor changes it.

.reports {
  --rpv-toolbar-bg: #1f2937;
  --rpv-accent: #7c3aed;
}