Customize the buttons to switch the scroll mode

The `SwitchScrollMode` component provided by the Scroll Mode plugin is used to create a custom switching button. It has two properties:
*: Required parameter
`children``RenderSwitchScrollModeProps => ReactElement`The render prop2.0.0
`mode`*`ScrollMode`The scroll mode2.0.0
The sample code below creates a button that clicking it will switch to the horizontal scroll mode:
import { ScrollMode } from '@react-pdf-viewer/core';
import { RenderSwitchScrollModeProps } from '@react-pdf-viewer/scroll-mode';
// Your render function
const scrollModePluginInstance = scrollModePlugin();
const { SwitchScrollMode } = scrollModePluginInstance;
<SwitchScrollMode mode={ScrollMode.Horizontal}>
{(props: RenderSwitchScrollModeProps) => (
// Update the styles if the current mode is active
backgroundColor: props.isSelected ? '#357edd' : 'transparent',
borderColor: props.isSelected ? 'transparent' : '#357edd',
color: props.isSelected ? '#fff' : '#000',
borderRadius: '4px',
borderStyle: 'solid',
borderWidth: '1px',
cursor: 'pointer',
padding: '8px',
Horizontal scrolling

See also