Skip to main content

Quick start

Give ReadiumView a file and it renders the publication:

import { ReadiumView } from 'react-native-readium';

export function Reader({ path }: { path: string }) {
return (
<ReadiumView
file={{ url: path }} // a local EPUB or PDF
onLocationChange={(locator) => console.log(locator)}
onPublicationReady={({ metadata, tableOfContents }) =>
console.log(metadata.title, tableOfContents)
}
/>
);
}

On iOS and Android, file.url is a local path, such as a book your app downloaded into its documents folder. On web it's the URL of an unpacked EPUB's manifest.json; see Web.

Where to go next​

To...See
Restore the reader's position, or react when it can't open a bookOpening publications
Turn pages, jump to a chapter or bookmarkNavigation
Change the theme, font size or marginsPreferences
Add highlights and notesHighlights and notes
Search the textSearch
Open LCP-protected booksReadium LCP

The example app puts all of these together.