Customize the rotate buttons

The `Rotate` component provided by the Rotate plugin is used to create a custom rotate button. It has two properties:
*: Required parameter
PropertyTypeDescriptionFrom
`direction`*`RotateDirection`The rotate direction2.0.0
`children``RenderRotateProps => ReactElement`The render prop2.0.0
`RotateDirection` provided by the `@react-pdf-viewer/core` package is an enum with two possible values:
The sample code below creates a button that clicking it will rotate the document counterclockwise:
import { RotateDirection } from '@react-pdf-viewer/core';
import { RenderRotateProps, rotatePlugin } from '@react-pdf-viewer/rotate';
// Your render function
const rotatePluginInstance = rotatePlugin();
const { Rotate } = rotatePluginInstance;
<Rotate direction={RotateDirection.Backward}>
{(props: RenderRotateProps) => (
<button
style={{
backgroundColor: '#357edd',
border: 'none',
borderRadius: '4px',
color: '#ffffff',
cursor: 'pointer',
padding: '8px',
}}
onClick={props.onClick}
>
Rotate backward
</button>
)}
</Rotate>;

See also