Skip to content

Introduction

a react wrapper for foliate-js - library for rendering e-books in the browser

Installation

sh
npm install react-book-reader --save
sh
pnpm add react-book-reader --save

Basic Usage

And in your react-component...

loading

Different Builds

ModuleFilename
UMD(for browsers)react-book-reader.umd.js
ES Module(for bundlers)react--book-reader.es.js

ReactReader Attributes

NameDescriptionTypeDefault
urlbook url or Filestring/File
locationset / update location of the bookstring/number
titlethe title of the bookstring
showTocwhether to show the tocbooleantrue

ReactReader props passed to inner BookView

NameDescriptionTypeDefault
urlbook url or Filestring/File
tocChangedwhen the reader has parsed the book you will receive an array of the chaptersfunction(toc)
nextPagedisplay next pagefunction
prevPagedisplay previous pagefunction
setLocationset the pagefunction(href)
LoadingViewif you want to customize the LoadingViewelement
ErrorViewif you want to customize the ErrorViewelement