`SwitchSelectionMode`
component provided by the Selection Mode plugin is used to create a custom switching button. It has two properties:Property | Type | Description | From |
---|---|---|---|
`children` | `RenderSwitchSelectionModeProps => ReactElement` | The render prop | 2.0.0 |
`mode` * | `SelectionMode` | The selection mode | 2.0.0 |
import { RenderSwitchSelectionModeProps, SelectionMode } from '@react-pdf-viewer/selection-mode';// Your render functionconst selectionModePluginInstance = selectionModePlugin();const { SwitchSelectionMode } = selectionModePluginInstance;<SwitchSelectionMode mode={SelectionMode.Hand}>{(props: RenderSwitchSelectionModeProps) => (<buttonstyle={{backgroundColor: '#357edd',border: 'none',borderRadius: '4px',color: '#ffffff',cursor: 'pointer',padding: '8px',}}onClick={props.onClick}>Hand tool</button>)}</SwitchSelectionMode>;