Toolbar plugin

The `toolbar` plugin combines different parts provided by other plugins such as


npm install '@react-pdf-viewer/toolbar';
The `toolbar` plugin is included in the default-layout plugin


1. Import the plugin and styles
import { toolbarPlugin } from '@react-pdf-viewer/toolbar';
// Import styles
import '@react-pdf-viewer/toolbar/lib/styles/index.css';
2. Create the plugin instance
const toolbarPluginInstance = toolbarPlugin(props?: ToolbarPluginProps);
See the Create a toolbar with more options example for more details about `ToolbarPluginProps`.
The plugin instance `toolbarPluginInstance` provides the following property:
`Toolbar``ReactElement`The default toolbar2.0.0
`fullScreenPluginInstance``FullScreenPlugin`The instance of the Full Screen plugin2.4.0
`getFilePluginInstance``GetFilePlugin`The instance of the Get File plugin2.4.0
`openPluginInstance``OpenPlugin`The instance of the Open plugin2.4.0
`pageNavigationPluginInstance``PageNavigationPlugin`The instance of the Page Navigation plugin2.4.0
`printPluginInstance``PrintPlugin`The instance of the Print plugin2.4.0
`propertiesPluginInstance``PropertiesPlugin`The instance of the Properties plugin2.4.0
`renderDefaultToolbar``Function`Render a custom toolbar based on the default toolbar. See this example2.10.0
`rotatePluginInstance``RotatePlugin`The instance of the Rotate plugin2.4.0
`scrollModePluginInstance``ScrollModePlugin`The instance of the Scroll Mode plugin2.4.0
`searchPluginInstance``SearchPlugin`The instance of the Search plugin2.4.0
`selectionModePluginInstance``SelectionModePlugin`The instance of the Selection Mode plugin2.4.0
`themePluginInstance``ThemePlugin`The instance of the Theme plugin2.6.0
`zoomPluginInstance``ZoomPlugin`The instance of the Zoom plugin2.4.0
3. Register the plugin
Register the `toolbar` plugin instance:
<Viewer plugins={[toolbarPluginInstance]} />


The `toolbar` plugin provides other useful property as following:
import { MoreIcon } from '@react-pdf-viewer/toolbar';
`MoreIcon``ReactElement`The three vertical dots icon2.0.0

See also


  • Add `data-testid` attribute to buttons in the toolbar
  • The number of pages slot `<NumberOfPages />` isn't correct when using the `renderToolbar`
  • Add new `renderDefaultToolbar` function
  • The plugin instances which can be accessed from an instance of the Toolbar plugin should be readonly
  • Fix an issue that the plugin can cause a re-render
  • Remove duplicate borders of keyword input
  • Search results are not highlighted
  • The plugin doesn't include the drop plugin anymore
  • The toolbar `Slot` has new `SwitchTheme` and `SwitchThemeMenuItem` components
  • Provide the accesses to the instance of other plugins that build the toolbar
  • Fix the type definitions of the `MoreActionsPopover` component
  • First release