Publira Comic Viewer
A composable, headless-UI React viewer for comics and manga. It provides the viewport, the spreads, and the page pipeline, and leaves the look of the reader to the application around it.
What it does
Headless UI architecture
Compose independent, tree-shakeable components and style them the way the rest of the application is styled. The bundled stylesheet is optional.
Responsive spreads
The viewer switches between single pages and double-page spreads with the width of its container, and reads right to left or left to right.
Pluggable page pipeline
Fetching, decryption, and transformation hang off the plugins API, so encrypted or generated pages need no fork of the viewer.
Virtualization
Only the pages near the reader are kept in memory, so a long chapter of high-resolution images does not exhaust a mobile browser.
Install it
npm install @publira/comic-viewerReact 19 or later is required as a peer dependency. Compose ComicViewer.Root with the parts the reader needs:
import * as ComicViewer from "@publira/comic-viewer";import type { ViewerPage } from "@publira/comic-viewer";import "@publira/comic-viewer/default.css";const pages: ViewerPage[] = [ { id: "page-1", src: "/pages/1.jpg", title: "Page 1" }, { id: "page-2", src: "/pages/2.jpg", title: "Page 2" },];const Reader = () => ( <ComicViewer.Root initialReadingDirection="rtl" pages={pages}> <ComicViewer.Viewport /> <ComicViewer.Toolbar /> <ComicViewer.PageNavigation /> </ComicViewer.Root>);Everything else — theming, controlled navigation, double-page grouping, lazy page metadata, plugins — is written down once, in the usage reference.