svelte-pdf-mini is a toolkit for building PDF experiences in Svelte 5: from a twenty-line viewer to a full research reader with highlights, side notes, citation cards and a table of contents. It is built on pdf.js and follows the conventions of bits-ui: compound parts, child snippets, bindable state and data-* attributes instead of imposed styles.
What you get
- A fast viewer. Virtualised pages rendered by a cancellable priority scheduler, eased zoom that stays centred on narrow pages and follows the cursor on wide ones, fit modes, one to four pages per row, book spreads, rotation and pinch-zoom on touch.
- Text that works. A selectable text layer and a shared text index (normalised text mapped back to PDF geometry) behind find, selection, copy and annotations.
- Annotations that survive. Highlights, boxes, notes, ink, shapes and free text, with side notes, undo/redo and a calm creation workflow. Export writes standard PDF annotations that Apple Preview, Acrobat, Chrome and Firefox display, and importing the file gives back exactly what you exported.
- Research-paper aids. From the PDF alone: sections, references, in-text citations with hover cards, figure and table previews, five table-of-contents views and reading progress. Online providers (OpenAlex, Semantic Scholar, Crossref) only enrich.
- Page themes. A calm paper tint by day and a hue-preserving recolour at night, plus invert, smart invert (figures kept), sepia, dim and custom strategies.
Three layers
Where next
Install the package in Installation, build a reader in the Quick start, then browse the components.