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 book | Opening publications |
| Turn pages, jump to a chapter or bookmark | Navigation |
| Change the theme, font size or margins | Preferences |
| Add highlights and notes | Highlights and notes |
| Search the text | Search |
| Open LCP-protected books | Readium LCP |
The example app puts all of these together.