Skip to content

Turning pages ​

How readers turn pages ​

  • Drag any corner or edge. The page folds along the line between where you grabbed it and your pointer, and stays bound to the spine.
  • Swipe across the middle of a page; it's held at its outer edge.
  • Flick: let go and the page lands open or shut depending on where it is and how fast it was moving.
  • Tap the outer thirds of the stage.
  • Buttons, the page strip, and the arrow, Page Up/Down, Space, Home and End keys.
  • Hover near a corner with a mouse and it lifts a little, as a hint.

Covers are stiff: they swing on the spine instead of curling. Set stiffCovers to false for a soft-cover book.

Physics ​

Released pages move on critically damped springs, so they settle without bouncing. Tune them with physics:

OptionDefault
fall0.0075Spring that drops a page after a drag. Higher is snappier.
auto0.0055Spring for turns started by a button, key or tap.
peek0.02Spring that lifts a corner under the mouse.
flick170How far ahead (ms) a flick carries the page when deciding where it lands.
lift0.12How high a falling page arcs off the paper, as a share of its height.

grip sets where a press grabs the page:

OptionDefault
edgeX0.15Share of the page width along the outer edge that grabs the edge itself.
edgeY0.08Share of the height at the top and bottom that grabs a corner.
peektrueLift corners under the mouse.

shading scales the light and shadow around the fold, from 0 (flat) up.

People who ask their system for reduced motion get pages that land at once.

Following along ​

onPageChange (Vue: @page-change) tells you where the reader is: the number of leaves turned (flipped), a label like "Pages 3–4 of 12", and the faces showing. onFlip fires as a page starts to turn, which is a good place for analytics or your own sound.

Turning from code ​

tsx
const flipbook = useRef<FlipbookHandle>(null)

<Flipbook ref={flipbook} book={book} />

flipbook.current?.next()
flipbook.current?.goToPage(5)
vue
<Flipbook ref="flipbook" :book="book" />

flipbook.value.next() flipbook.value.goToPage(5)
js
const flipbook = new Flipbook(el, { book })

flipbook.next()
flipbook.goToPage(5)
flipbook.update({ shading: 0.5 })
flipbook.destroy()

go(flipped) jumps to a number of turned leaves: 0 is the closed front cover.