ViewerPDFViewer
PDFViewer
Web only
Iframe PDF viewer for client-side generated documents.
import { PDFViewer, Document, Page, Text } from '@react-pdf/renderer';
const App = () => (
<PDFViewer style={{ width: '100%', height: '90vh' }}>
<Document>
<Page size="A4">
<Text>Rendered in the browser</Text>
</Page>
</Document>
</PDFViewer>
);Valid props
| Prop name | Description | Type | Default |
|---|---|---|---|
| style | Defines iframe styles | Object, Array | undefined |
| className | Defines iframe class name | _String _ | undefined |
| children | PDF document implementation | Document | undefined |
| width | Width of embedded PDF iframe | String, Number | undefined |
| height | Height of embedded PDF iframe | String, Number | undefined |
| innerRef | Ref to the underlying iframe element | Ref | undefined |
| showToolbar | Render the toolbar. Supported on Chrome, Edge and Safari | Boolean | true |
Other props are passed through to the iframe.