`theme`
plugin provides components that can be used to switch between the light and dark themes.npm install '@react-pdf-viewer/theme';
import { themePlugin } from '@react-pdf-viewer/theme';
const themePluginInstance = themePlugin();
`themePluginInstance`
provides the following properties:Property | Type | Description | From |
---|---|---|---|
`SwitchTheme` | `ReactElement` | Customizable component to switch themes | 2.6.0 |
`SwitchThemeButton` | `ReactElement` | The default button to switch themes | 2.6.0 |
`SwitchThemeMenuItem` | `ReactElement` | The default menu item to switch themes | 2.6.0 |
`theme`
plugin instance:<Viewer plugins={[themePluginInstance]} />
`theme`
plugin provides other properties as following:import { DarkIcon, LightIcon } from '@react-pdf-viewer/theme';
Property | Type | Description | From |
---|---|---|---|
`DarkIcon` | `ReactElement` | The dark theme icon | 2.6.0 |
`LightIcon` | `ReactElement` | The light theme icon | 2.6.0 |