Skip to content

Getting started ​

Toneflix Flipbook is an expressive flipbook for creating personalised and interactive reading and photo viewing experiences: albums, stories, portfolios and keepsakes that people turn through rather than scroll past.

You describe a book as plain data. The same data looks and turns the same in every package, because they all share one framework-free core.

PackageFor
@toneflix/flipbookAny web page, no framework. Also a <script> tag build.
@toneflix/flipbook-reactReact 18 and up, including server rendering.
@toneflix/flipbook-vueVue 3.
@toneflix/flipbook-nativeReact Native and Expo.
@toneflix/flipbook-coreThe physics and book model, to build your own renderer.

Every package re-exports the core, so you only install one.

Install ​

bash
npm install @toneflix/flipbook-react
bash
npm install @toneflix/flipbook-vue
bash
npm install @toneflix/flipbook
bash
npx expo install @toneflix/flipbook-native react-native-svg expo-screen-orientation

Show a book ​

The viewer fills its parent, so give the parent a height. Web packages need their stylesheet once.

tsx
import { Flipbook } from '@toneflix/flipbook-react'
import '@toneflix/flipbook-react/style.css'

export function Book({ book }) {
  return (
    <div style={{ height: '100vh' }}>
      <Flipbook book={book} />
    </div>
  )
}
vue
<script setup>
import { Flipbook } from '@toneflix/flipbook-vue'
import '@toneflix/flipbook-vue/style.css'

defineProps(['book'])
</script>

<template>
  <div style="height: 100vh">
    <Flipbook :book="book" />
  </div>
</template>
js
import { Flipbook } from '@toneflix/flipbook'
import '@toneflix/flipbook/style.css'

const flipbook = new Flipbook(document.querySelector('#book'), { book })
html
<link rel="stylesheet" href="https://unpkg.com/@toneflix/flipbook/dist/style.css" />
<div id="book" style="height: 100vh"></div>
<script src="https://unpkg.com/@toneflix/flipbook"></script>
<script>
  new Flipbook.Flipbook(document.querySelector('#book'), { book })
</script>
tsx
import { View } from 'react-native'
import { Flipbook } from '@toneflix/flipbook-native'

export function Book({ book }) {
  return (
    <View style={{ flex: 1 }}>
      <Flipbook book={book} />
    </View>
  )
}

A first book ​

A book is plain data: a title, a few looks, and pages of photos.

ts
import type { FlipbookBook } from '@toneflix/flipbook-react'

const book: FlipbookBook = {
  title: 'Places We Wandered',
  author: 'Ada',
  year: 2026,
  cover: { src: '/photos/lake.jpg' },
  theme: 'classic',
  paper: 'ivory',
  frame: 'mat',
  pages: [
    { layout: 'single', photos: [{ src: '/photos/lake.jpg' }], caption: 'First light' },
    { layout: 'pair', photos: [{ src: '/photos/dunes.jpg' }, { src: '/photos/moon.jpg' }] },
  ],
}

Books and pages covers every field. To try options without installing anything, open the playground.

Fonts ​

Book text uses the Fraunces serif when it's available and falls back to Georgia. Load Fraunces from Google Fonts to match these docs, or set your own face with the --fb-serif custom property on the web and the fonts prop on React Native.