Skip to content
Basic Toolbar Usage

React PDF provides a default UI toolbar (top bar and left sidebar) which you can readily use without much customization. The Viewer will display the default toolbar when the RPLayout component and use toolbar prop are used.

<RPConfig>
<RPProvider src="YOUR_PDF_FILE">
<RPLayout toolbar>
<RPPages />
</RPLayout>
</RPProvider>
</RPConfig>
React PDF viewer with RPLayout default toolbar showing top bar and left sidebar enabled

To hide the toolbar, simply remove the toolbar prop. This will make the toolbar hide.

<RPConfig>
<RPProvider src="YOUR_PDF_FILE">
<RPLayout
// Hide toolbar
// toolbar
>
<RPPages />
</RPLayout>
</RPProvider>
</RPConfig>
React PDF viewer rendered without toolbar using RPLayout component without toolbar prop

To hide the top bar without hiding the left sidebar, use the following setting:

<RPConfig>
<RPProvider src="YOUR_PDF_FILE">
<RPLayout
toolbar={{
// Hide top bar
topbar: false,
leftSidebar: { component: <></> }
}}
>
<RPPages />
</RPLayout>
</RPProvider>
</RPConfig>
React PDF Kit viewer with top bar hidden showing PDF pages without toolbar or sidebar

To hide the left sidebar without hiding the top bar, use the following setting:

<RPConfig>
<RPProvider src="YOUR_PDF_FILE">
<RPLayout
toolbar={{
topbar: { component: <></> }
// Hide left sidebar
leftSidebar: false,
}}
>
<RPPages />
</RPLayout>
</RPProvider>
</RPConfig>
React PDF viewer with left sidebar hidden and top bar visible via RPLayout slots prop

To hide all icons on the toolbar and show the top bar and left sidebar without icons.

<RPConfig>
<RPProvider src="YOUR_PDF_FILE">
<RPLayout
toolbar={{
// Hide all icons on toolbar
topbar: { component: <></> },
leftSidebar: { component: <></> }
}}
>
<RPPages />
</RPLayout>
</RPProvider>
</RPConfig>
React PDF Kit RPLayout toolbar with all top bar icons hidden via RPSlots configuration

More information for a full list of available toolbar options and their descriptions, see the RPLayout.