react-book-viewer
v1.2.2
Published
A book viewer with React
Downloads
8
Readme
react-book-viewer
A request from the author
plz let me know by issue if you've found a bug or have request for new features or something. i'd love your issues thx. https://github.com/ao-spirogyra/react-book-viewer/issues
Getting started
Installation
npm install react-book-viewer
or yarn add react-book-viewer
Useage
import {BookViewer} from 'react-book-viewer'
cosnt App = () => {
pages = ['imgSrc1', 'imgSrc2', 'imgSrc3']
return (
<BookViewer pages={pages}/>
)
}
you can insert header if you want
const offSetHeight = '80px'
const Header () = {
return (
<div className='header' style={{height: offSetHeight}}>
<a id="link" href='/'>> top page</a>
<a id="link" href='/aboutus'>> about us</a>
<a id="link" href='/contactus'>> contact us</a>
<a id="link" href='/joinus'>> join us</a>
</div>
)
}
const children = {
Render: Header
height: offSetHeight
}
cosnt App = () => {
pages = ['imgSrc1', 'imgSrc2', 'imgSrc3']
return (
<BookViewer pages={pages} children={children}/>
)
}
you can switch direction in which pages go
<BookViewer pages={pages} children={children} direction='ltr'/>
default is 'rtl' so direction='rtl'
can be abbreviated