u/Impact31

Image 1 — I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library
Image 2 — I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library
Image 3 — I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library
Image 4 — I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library
Image 5 — I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library
Image 6 — I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library
Image 7 — I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library
Image 8 — I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library
Image 9 — I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library

I built a research-paper reader in Svelte 5, and split its PDF layer into a headless component library

Xivly is an open-source reader for research papers (video above).

One SvelteKit codebase, three targets.
The same app ships as a Tauri desktop app, a static site on GitHub Pages, and a Chrome extension. Platform differences sit behind a small adapter: Rust file access on desktop, the File System Access API (or OPFS) on the web. The extension build switches SvelteKit to the hash router, since an extension has no fallback page for /read, and moves the inline bootstrap script into a file, since extension pages can't run inline scripts.

svelte-pdf-mini.
As the reader grew, I pulled the PDF logic out into a reusable library, in the spirit of bits-ui / melt-ui: headless, composable parts (Document.Root, Viewer.Root, Viewer.Pages…), each taking class, style, a bindable ref and a child snippet. State lives in plain runes classes on top of a framework-free core. It covers virtualised rendering, zoom, find, annotations that round-trip as standard PDF annotations (they open in Preview and Acrobat), and research-paper extras: citations with hover cards, figures, tables and cross-references.

```svelte
<Document.Root src="https://arxiv.org/pdf/1706.03762">
<Viewer.Root zoomMode="page-width">
<Viewer.Viewport><Viewer.Pages /></Viewer.Viewport>
</Viewer.Root>
</Document.Root>
```

Xivly: https://github.com/julien-blanchon/xivly
svelte-pdf-mini: https://github.com/julien-blanchon/svelte-pdf-mini (docs: https://julien-blanchon.github.io/svelte-pdf-mini)

u/Impact31 — 4 days ago