Toolbar plugin

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

Install

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

Usage

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:
PropertyTypeDescriptionFrom
ToolbarReactElementThe default toolbar2.0.0
fullScreenPluginInstanceFullScreenPluginThe instance of the Full Screen plugin2.4.0
getFilePluginInstanceGetFilePluginThe instance of the Get File plugin2.4.0
openPluginInstanceOpenPluginThe instance of the Open plugin2.4.0
pageNavigationPluginInstancePageNavigationPluginThe instance of the Page Navigation plugin2.4.0
printPluginInstancePrintPluginThe instance of the Print plugin2.4.0
propertiesPluginInstancePropertiesPluginThe instance of the Properties plugin2.4.0
rotatePluginInstanceRotatePluginThe instance of the Rotate plugin2.4.0
scrollModePluginInstanceScrollModePluginThe instance of the Scroll Mode plugin2.4.0
searchPluginInstanceSearchPluginThe instance of the Search plugin2.4.0
selectionModePluginInstanceSelectionModePluginThe instance of the Selection Mode plugin2.4.0
themePluginInstanceThemePluginThe instance of the Theme plugin2.6.0
zoomPluginInstanceZoomPluginThe instance of the Zoom plugin2.4.0
3. Register the plugin
Register the toolbar plugin instance:
<Viewer plugins={[toolbarPluginInstance]} />

Properties

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

See also

Changelog

v2.9.0
  • The plugin instances which can be accessed from an instance of the Toolbar plugin should be readonly
v2.6.1
  • Fix an issue that the plugin can cause a re-render
  • Remove duplicate borders of keyword input
  • Search results are not highlighted
v2.6.0
  • The plugin doesn't include the drop plugin anymore
  • The toolbar Slot has new SwitchTheme and SwitchThemeMenuItem components
v2.4.0
  • Provide the accesses to the instance of other plugins that build the toolbar
  • Fix the type definitions of the MoreActionsPopover component
v2.0.0
  • First release