Remove some parts from the default toolbar

As you know, the Toolbar plugin provides the `<Toolbar />` component that contains different slots.
It is possible to create a cloned version of the toolbar by using the `renderDefaultToolbar` function and transforming the toolbar to your own one. It is recommended to take a look at the customize the default toolbar example to see the details.
Using the same approach, we can remove existing parts from the default toolbar. In the following piece of code, the `Download`, `EnterFullScreen` and `SwitchTheme` slots are removed the from the default toolbar:
import type { ToolbarSlot, TransformToolbarSlot } from '@react-pdf-viewer/toolbar';
const toolbarPluginInstance = toolbarPlugin();
const { renderDefaultToolbar, Toolbar } = toolbarPluginInstance;
const transform: TransformToolbarSlot = (slot: ToolbarSlot) => ({
...slot,
// These slots will be empty
Download: () => <></>,
EnterFullScreen: () => <></>,
SwitchTheme: () => <></>,
});
The transformation can be passed to the `renderDefaultToolbar` function as following:
const { renderDefaultToolbar, Toolbar } = toolbarPluginInstance;
<Toolbar>{renderDefaultToolbar(transform)}</Toolbar>;
If you want to archive the same things with the default layout, then here it is:

See also