Full Screen plugin

The `full-screen` plugin provides a button that can be used to view the PDF document in full screen mode. It is possible to customize the button as well.


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


1. Import the plugin and styles
import { fullScreenPlugin } from '@react-pdf-viewer/full-screen';
// Import styles
import '@react-pdf-viewer/full-screen/lib/styles/index.css';
2. Create the plugin instance
const fullScreenPluginInstance = fullScreenPlugin(props?: FullScreenPluginProps);
The `fullScreenPlugin()` function takes a `FullScreenPluginProps` parameter that consists of the following properties:
(? denotes an optional property)
`enableShortcuts`?`boolean`Enable shortcuts2.9.0
`getFullScreenTarget?``Function`Indicate the custom full screen element. See this example3.0.0
`onEnterFullScreen?``Zoom => void`Triggered after entering the full screen mode2.3.1
`onExitFullScreen?``Zoom => void`Triggered after exiting the full screen mode2.3.1
`renderExitFullScreenButton?``Function`Render a custom button to exit the full screen mode. See this example3.0.0
By default, the shortcuts are enabled. Users can press `ctrl` + `cmd` + `F` (on macOS) or `F11` (on other operating systems) to enter the full screen mode.
`Zoom` is the type defined as
import { SpecialZoomLevel } from '@react-pdf-viewer/core';
type Zoom = (scale: number | SpecialZoomLevel) => void;
The plugin instance `fullScreenPluginInstance` provides the following properties:
`EnterFullScreen``ReactElement`Customizable full screen button2.0.0
`EnterFullScreenButton``ReactElement`The default full screen button2.0.0
`EnterFullScreenMenuItem``ReactElement`The default full screen menu item2.5.0
3. Register the plugin
Finally, register the `full-screen` plugin instance:
<Viewer plugins={[fullScreenPluginInstance]} />


The `full-screen` plugin provides other useful properties as following:
import { ExitFullScreenIcon, FullScreenIcon } from '@react-pdf-viewer/full-screen';
`ExitFullScreenIcon``ReactElement`The exit full screen icon2.0.0
`FullScreenIcon``ReactElement`The full screen icon2.0.0

See also


  • Typo in full screen change event
  • The full screen button and menu item are disabled on browsers that don't support full screen APIs. It happens on iOS Safari and iOS Chrome, for example.
  • Add new `renderExitFullScreenButton` option to customize the button to exit the full screen mode
  • Add new `getFullScreenTarget` option to set the full screen element
  • Support shortcuts
  • Provide new callbacks (`onEnterFullScreen` and `onExitFullScreen`) that are triggered after entering and exiting the full screen mode
  • First release