Skip to content

Viewer options ​

The React, Vue and vanilla viewers share these options. React and Vue take them as props; the vanilla Flipbook takes them as its second argument and in update().

OptionTypeDefault
bookFlipbookBookrequiredThe book.
startPagenumberOpen at this page (1-based) instead of the cover.
layout'auto' | 'spread' | 'single''auto'Two pages, one page, or whichever fits the box.
controlsbooleantrueShow the top and bottom bars.
autoHidenumber | false3200Hide the bars after this many ms without movement.
thumbnailsbooleantruePage thumbnails in the bottom bar.
soundbooleanfalsePlay a paper sound on each turn.
soundButtonbooleantrueLet readers switch the sound. Their choice is remembered.
fullscreenButtonbooleantrue
fullscreenPromptbooleanfalseAsk to open full screen.
landscapebooleantrueAsk phones held upright to turn sideways.
keyboardboolean | 'global'trueArrow, Page and Home/End keys while the book has focus, or anywhere.
stiffCoversbooleantrueCovers swing like board instead of curling.
physicsPartial<TurnPhysics>Spring tuning.
gripPartial<GripOptions>Where pages can be grabbed.
shadingnumber1Strength of the light and shadow around a turning page.
backgroundstringcover glowAny CSS background behind the book.
labelsPartial<FlipbookLabels>EnglishButton and status text, for translation.
onPageChange(place) => voidplace is { flipped, label, faces }. In Vue, the page-change event.
onFlip() => voidA page started to turn over. In Vue, the flip event.

React also takes topLeft, topRight (extra top-bar content), className and style.

React Native ​

The native viewer takes the same options except sound, soundButton, fullscreenButton, fullscreenPrompt and keyboard, and adds:

PropType
fonts{ serif?, serifItalic?, sans? }Loaded font family names for book text.
topLeft, topRightReactNodeExtra top-bar content, e.g. a close button.
styleStyleProp<ViewStyle>

landscape locks the screen to landscape when expo-screen-orientation is installed.

Handle ​

React and React Native refs, Vue's exposed methods, and the vanilla instance all have:

next(), prev()Turn one page.
goToPage(page)Open at a page (1-based).
go(flipped)Open with this many leaves on the left. 0 is the closed front cover.
readerThe FlipbookReader. In Vue, instance.reader.

Labels ​

DEFAULT_LABELS holds the English text. Override any of it:

tsx
<Flipbook book={book} labels={{ next: 'Page suivante', previous: 'Page précédente', byline: (author) => `par ${author}` }} />

CSS custom properties ​

Set these on the viewer or any ancestor (web only).

Property
--fb-serifBook text face. Defaults to Fraunces, then Georgia.
--fb-sansControls and captions.
--fb-accentThe selected slot in editors.
--fb-highlightThe current thumbnail, and a slot with a photo dragged over it.