Example: Use the default layout

Following is an example of displaying a PDF document using the default layout:

import { Viewer } from '@react-pdf-viewer/core';
import { defaultLayoutPlugin } from '@react-pdf-viewer/default-layout';

import '@react-pdf-viewer/core/lib/styles/index.css';
import '@react-pdf-viewer/default-layout/lib/styles/index.css';

// Your render function
const defaultLayoutPluginInstance = defaultLayoutPlugin();

return (
    <div
        style={{
            height: '100%',
        }}
    >
        <Viewer
            fileUrl='/assets/pdf-open-parameters.pdf'
            plugins={[
                defaultLayoutPluginInstance,
            ]}
        />
    </div>
);

(The sample code)

Related examples