Skip to content

Theme plugin

The theme plugin provides components that can be used to switch between the light and dark themes.

Install

> npm install @sse-ui/pdf-theme;

OR

> yarn add @sse-ui/pdf-theme;

The theme plugin is included in the toolbar and default-layout plugins

Usage

1. Import the plugin

javascript
import { themePlugin } from "@sse-ui/pdf-theme";

2. Create the plugin instance

javascript
const themePluginInstance = themePlugin();

The plugin instance themePluginInstance provides the following properties:

PROPERTYTYPEDESCRIPTIONFROM
SwitchThemeReactElementCustomizable component to switch themes1.0.0
SwitchThemeButtonReactElementThe default button to switch themes1.0.0
SwitchThemeMenuItemReactElementThe default menu item to switch themes1.0.0

3. Register the plugin

Register the theme plugin instance:

javascript
<Viewer plugins={[themePluginInstance]} />

Properties

The theme plugin provides other properties as following:

javascript
import { DarkIcon, LightIcon } from "@sse-ui/pdf-theme";
PROPERTYTYPEDESCRIPTIONFROM
DarkIconReactElementThe dark theme icon1.0.0
LightIconReactElementThe light theme icon1.0.0

Released under the MIT License.