AccueilComponentsDocumentViewer

DocumentViewer

Viewer de documents (PDF, Image). Ctrl/⌘ + molette pour zoomer, double-clic pour revenir à 100 %, bouton plein écran avec allowFullscreen.
ui
Web only
DocumentImageEx
Document image1 / 1
tsx
export const DocumentImageEx = () => (
<Box width="100%" maxW={500} height={500}>
<DocumentViewer
title="Document image"
type="image"
allowFullscreen
source="https://picsum.photos/1000/2000"
height="100%"
/>
</Box>
);
DocumentPdf
Document PDF1 / 1
tsx
export const DocumentPdf = () => (
<Box width="100%" height={400} maxW={500}>
<DocumentViewer title="Document PDF" type="pdf" source="/document-exemple.pdf" height="100%" allowFullscreen />
</Box>
);
DocumentPdfError
Document PDF en erreur1 / 1
tsx
export const DocumentPdfError = () => (
<Box width="100%" height={400} maxW={500}>
<DocumentViewer
title="Document PDF en erreur"
type="pdf"
source="https://example.com/document-inexistant.pdf"
height="100%"
/>
</Box>
);
WithChildren
Document PDF1 / 1
Contenu enfant
tsx
export const WithChildren = () => (
<Box width="100%" height={600}>
<DocumentViewer title="Document PDF" type="pdf" source="/document-exemple.pdf" height="100%">
<Box p={'2W'}>
<Typography>Contenu enfant</Typography>
</Box>
</DocumentViewer>
</Box>
);
Alveole UI Kit — v2.0.0-alpha.30