Docs / Files / File Thumbnail
File Thumbnail
PDF page thumbnail rendered on a canvas through the shared PDF engine. Dark mode is
controlled by the parent through isDark; the checkbox below is the page's own
control.
Differences from upstream
- Same export name,
FileThumbnail.classis accepted alongside the upstreamclassName. The loading overlay is built in rather than exported asFileThumbnailLoadingOverlay. previewContentis a Svelte snippet instead of a React node.- Port addition: built-in PDF page rendering. Pass
pdfUrl(orpdfFile) withpageNumberandwidth, and only that page renders onto a canvas through PDF.js. Upstream expects the thumbnail image from your own pipeline. - Dark mode is set by the parent through
isDark. Like upstream there is no theme switch inside the thumbnail. - Port-only exports for the built-in PDF rendering:
clampPageNumber,DEFAULT_THUMBNAIL_PAGE,DEFAULT_THUMBNAIL_WIDTH,renderLoadedPdfThumbnail,renderPdfThumbnail,thumbnailScale, plus the typesPdfThumbnailRenderOptions,PdfThumbnailRenderResult.FileThumbnailPropsis exported as a type, as upstream does.