A page-turn effect for the web
Pick up any corner and pull. Let go past the middle and the page turns; let go early and it settles back.
A click on either half turns the page that way. On a touch screen, a swipe does the same.
Covers are hard, so they swing as one stiff sheet. Inner pages bend along the fold, the way paper does.
Pages are ordinary elements. Text, images, forms, video - whatever a page holds keeps working.
The end
A page-turn effect for React
Wrap one in Page to make it hard, or to put a class or style on the page element itself.
The book owns the page elements. Your components render inside them.
Change one and the book is rebuilt on the same page. Children can change whenever.
This page was server-rendered by the docs site and hydrated after.
The end
> ); } ``` ## What the props do [Section titled “What the props do”](#what-the-props-do) * Every core option is a prop. Change one and the book is rebuilt on the same page it was showing. Children can change whenever. * `ref` gives you the core `Book`, so `flipNext`, `flipTo`, `page`, `on` and the rest are right there. * `page` makes the book controlled, and `onFlip` tells you the first page of the spread that landed. The [controlled page example](/examples/controlled-page/) shows the two working together. * Each core event is a prop: `onInit`, `onUpdate`, `onFlip`, `onChangeState`, `onChangeOrientation`. * The component ships with `"use client"` and renders on the server. The demo above was server-rendered by this site and hydrated after. Every prop is in the [reference](/api/openpageflip/react/), generated from the source. # Controlled page > Drive a React FlipBook from state, and let onFlip keep that state honest when the reader turns pages by hand. When `page` changes, the book flips there. When the reader turns a page by hand, `onFlip` reports the first page of the spread that landed, so the state follows the book as much as the book follows the state. Try picking a chapter that sits on the right-hand side of a spread - the number settles on the spread’s first page, not the one you picked. Controlled.tsx ```tsx import "@openpageflip/core/styles.css"; import { FlipBook, Page } from "@openpageflip/react"; import { useState } from "react"; const chapters = [ "Cover", "Chapter one", "Chapter two", "Chapter three", "Chapter four", "The end", ]; export default function Controlled() { const [page, setPage] = useState(0); return ( <> {/* `page` drives the book; `onFlip` reports where it landed, so the two never disagree. */}
Showing page {page + 1} of {chapters.length}
> ); } ``` # Playground > Every option as a control, the book's API as buttons, and the code that gives you exactly what you're looking at. Change anything and the book is rebuilt with the new options, on the page it was showing. The code at the bottom is generated from the controls, so it always matches the book above it - copy it into your app and you get exactly this book. # One page at a time > A book that stays one page wide on any screen and only turns from its corners, so the page itself is free for reading. Some books shouldn’t open into a spread - a phone-sized reader, say, where one page is the whole point. This one stays single however wide the container gets, and only the corners turn it, so clicking, selecting and following links in the middle of the page just work. On a mouse, hovering a corner lifts it so you can see where to grab. single-page.ts ```ts import "@openpageflip/core/styles.css"; import { type Book, createBook } from "@openpageflip/core"; export function mount(container: HTMLElement): Book { return createBook(container, { width: 360, // the page's ratio, and with maxWidth below, its largest size height: 480, size: "stretch", // shrinks to fit a phone maxWidth: 360, // but never grows past one phone-sized page layout: "single", // one page, however wide the container is click: "corners", // the middle of the page is left to whatever it holds }); } ``` # openpageflip ## Modules [Section titled “Modules”](#modules) * [@openpageflip/core](/api/openpageflip/core/) * [@openpageflip/react](/api/openpageflip/react/) # @openpageflip/core Framework-agnostic page-turn engine: `createBook`, its options, events and types. ## Type Aliases [Section titled “Type Aliases”](#type-aliases) * [Book](/api/openpageflip/core/type-aliases/book/) * [BookEvents](/api/openpageflip/core/type-aliases/bookevents/) * [BookOptions](/api/openpageflip/core/type-aliases/bookoptions/) * [BookRect](/api/openpageflip/core/type-aliases/bookrect/) * [ClickMode](/api/openpageflip/core/type-aliases/clickmode/) * [Clock](/api/openpageflip/core/type-aliases/clock/) * [CreateBookOptions](/api/openpageflip/core/type-aliases/createbookoptions/) * [Emitter](/api/openpageflip/core/type-aliases/emitter/) * [FlipCorner](/api/openpageflip/core/type-aliases/flipcorner/) * [FlipDirection](/api/openpageflip/core/type-aliases/flipdirection/) * [FlipFrame](/api/openpageflip/core/type-aliases/flipframe/) * [FlipState](/api/openpageflip/core/type-aliases/flipstate/) * [Fold](/api/openpageflip/core/type-aliases/fold/) * [FoldInput](/api/openpageflip/core/type-aliases/foldinput/) * [FoldIntersections](/api/openpageflip/core/type-aliases/foldintersections/) * [Frame](/api/openpageflip/core/type-aliases/frame/) * [Layout](/api/openpageflip/core/type-aliases/layout/) * [LayoutOptions](/api/openpageflip/core/type-aliases/layoutoptions/) * [LayoutResult](/api/openpageflip/core/type-aliases/layoutresult/) * [Listener](/api/openpageflip/core/type-aliases/listener/) * [Orientation](/api/openpageflip/core/type-aliases/orientation/) * [PageDensity](/api/openpageflip/core/type-aliases/pagedensity/) * [Point](/api/openpageflip/core/type-aliases/point/) * [Rect](/api/openpageflip/core/type-aliases/rect/) * [RectPoints](/api/openpageflip/core/type-aliases/rectpoints/) * [ResolvedOptions](/api/openpageflip/core/type-aliases/resolvedoptions/) * [Segment](/api/openpageflip/core/type-aliases/segment/) * [ShadowData](/api/openpageflip/core/type-aliases/shadowdata/) * [SizeMode](/api/openpageflip/core/type-aliases/sizemode/) ## Variables [Section titled “Variables”](#variables) * [ClickMode](/api/openpageflip/core/variables/clickmode/) * [FlipCorner](/api/openpageflip/core/variables/flipcorner/) * [FlipDirection](/api/openpageflip/core/variables/flipdirection/) * [FlipState](/api/openpageflip/core/variables/flipstate/) * [Layout](/api/openpageflip/core/variables/layout/) * [Orientation](/api/openpageflip/core/variables/orientation/) * [PageDensity](/api/openpageflip/core/variables/pagedensity/) * [SizeMode](/api/openpageflip/core/variables/sizemode/) ## Functions [Section titled “Functions”](#functions) * [computeFold](/api/openpageflip/core/functions/computefold/) * [computeLayout](/api/openpageflip/core/functions/computelayout/) * [createBook](/api/openpageflip/core/functions/createbook/) # computeFold > **computeFold**(`input`): [`Fold`](/api/openpageflip/core/type-aliases/fold/) | `null` Defined in: [core/src/geometry/fold.ts:65](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L65) Returns `null` when the point is degenerate (the corner is at rest, or the fold line would coincide with a page edge). Callers keep the previous fold for that frame, as the original did. ## Parameters [Section titled “Parameters”](#parameters) ### input [Section titled “input”](#input) [`FoldInput`](/api/openpageflip/core/type-aliases/foldinput/) ## Returns [Section titled “Returns”](#returns) [`Fold`](/api/openpageflip/core/type-aliases/fold/) | `null` # computeLayout > **computeLayout**(`containerWidth`, `containerHeight`, `options`): [`LayoutResult`](/api/openpageflip/core/type-aliases/layoutresult/) Defined in: [core/src/layout.ts:24](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L24) Page size and orientation for a container. Same arithmetic as the original, so the book lands on the same pixels; `layout` only overrides the “is the container too narrow” decision. ## Parameters [Section titled “Parameters”](#parameters) ### containerWidth [Section titled “containerWidth”](#containerwidth) `number` ### containerHeight [Section titled “containerHeight”](#containerheight) `number` ### options [Section titled “options”](#options) [`LayoutOptions`](/api/openpageflip/core/type-aliases/layoutoptions/) ## Returns [Section titled “Returns”](#returns) [`LayoutResult`](/api/openpageflip/core/type-aliases/layoutresult/) # createBook > **createBook**(`container`, `userOptions`): [`Book`](/api/openpageflip/core/type-aliases/book/) Defined in: [core/src/book.ts:63](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L63) ## Parameters [Section titled “Parameters”](#parameters) ### container [Section titled “container”](#container) `HTMLElement` ### userOptions [Section titled “userOptions”](#useroptions) [`CreateBookOptions`](/api/openpageflip/core/type-aliases/createbookoptions/) ## Returns [Section titled “Returns”](#returns) [`Book`](/api/openpageflip/core/type-aliases/book/) # Book > **Book** = `object` Defined in: [core/src/book.ts:28](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L28) ## Properties [Section titled “Properties”](#properties) ### off [Section titled “off”](#off) > **off**: [`Emitter`](/api/openpageflip/core/type-aliases/emitter/)<[`BookEvents`](/api/openpageflip/core/type-aliases/bookevents/)>\[`"off"`] Defined in: [core/src/book.ts:37](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L37) *** ### on [Section titled “on”](#on) > **on**: [`Emitter`](/api/openpageflip/core/type-aliases/emitter/)<[`BookEvents`](/api/openpageflip/core/type-aliases/bookevents/)>\[`"on"`] Defined in: [core/src/book.ts:36](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L36) *** ### orientation [Section titled “orientation”](#orientation) > `readonly` **orientation**: [`Orientation`](/api/openpageflip/core/type-aliases/orientation/) Defined in: [core/src/book.ts:32](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L32) *** ### page [Section titled “page”](#page) > `readonly` **page**: `number` Defined in: [core/src/book.ts:30](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L30) First page of the open spread, zero-based. *** ### pageCount [Section titled “pageCount”](#pagecount) > `readonly` **pageCount**: `number` Defined in: [core/src/book.ts:31](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L31) *** ### rect [Section titled “rect”](#rect) > `readonly` **rect**: [`BookRect`](/api/openpageflip/core/type-aliases/bookrect/) Defined in: [core/src/book.ts:34](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L34) *** ### state [Section titled “state”](#state) > `readonly` **state**: [`FlipState`](/api/openpageflip/core/type-aliases/flipstate/) Defined in: [core/src/book.ts:33](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L33) ## Methods [Section titled “Methods”](#methods) ### destroy() [Section titled “destroy()”](#destroy) > **destroy**(): `void` Defined in: [core/src/book.ts:55](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L55) Stop everything, drop listeners and observers, and restore the DOM. #### Returns [Section titled “Returns”](#returns) `void` *** ### flipNext() [Section titled “flipNext()”](#flipnext) > **flipNext**(`corner?`): `Promise`<`boolean`> Defined in: [core/src/book.ts:40](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L40) Animated turns. Resolve with `false` when there is nothing to turn to. #### Parameters [Section titled “Parameters”](#parameters) ##### corner? [Section titled “corner?”](#corner) [`FlipCorner`](/api/openpageflip/core/type-aliases/flipcorner/) #### Returns [Section titled “Returns”](#returns-1) `Promise`<`boolean`> *** ### flipPrev() [Section titled “flipPrev()”](#flipprev) > **flipPrev**(`corner?`): `Promise`<`boolean`> Defined in: [core/src/book.ts:41](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L41) #### Parameters [Section titled “Parameters”](#parameters-1) ##### corner? [Section titled “corner?”](#corner-1) [`FlipCorner`](/api/openpageflip/core/type-aliases/flipcorner/) #### Returns [Section titled “Returns”](#returns-2) `Promise`<`boolean`> *** ### flipTo() [Section titled “flipTo()”](#flipto) > **flipTo**(`page`, `corner?`): `Promise`<`boolean`> Defined in: [core/src/book.ts:42](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L42) #### Parameters [Section titled “Parameters”](#parameters-2) ##### page [Section titled “page”](#page-1) `number` ##### corner? [Section titled “corner?”](#corner-2) [`FlipCorner`](/api/openpageflip/core/type-aliases/flipcorner/) #### Returns [Section titled “Returns”](#returns-3) `Promise`<`boolean`> *** ### redraw() [Section titled “redraw()”](#redraw) > **redraw**(): `void` Defined in: [core/src/book.ts:53](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L53) Redraw the current frame without measuring, after something else rewrote page attributes. Cheap. #### Returns [Section titled “Returns”](#returns-4) `void` *** ### setPages() [Section titled “setPages()”](#setpages) > **setPages**(`pages`): `void` Defined in: [core/src/book.ts:49](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L49) Replace the page elements. Keeps the current page where possible. #### Parameters [Section titled “Parameters”](#parameters-3) ##### pages [Section titled “pages”](#pages) `Iterable`<`HTMLElement`> #### Returns [Section titled “Returns”](#returns-5) `void` *** ### turnNext() [Section titled “turnNext()”](#turnnext) > **turnNext**(): `void` Defined in: [core/src/book.ts:45](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L45) #### Returns [Section titled “Returns”](#returns-6) `void` *** ### turnPrev() [Section titled “turnPrev()”](#turnprev) > **turnPrev**(): `void` Defined in: [core/src/book.ts:46](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L46) #### Returns [Section titled “Returns”](#returns-7) `void` *** ### turnTo() [Section titled “turnTo()”](#turnto) > **turnTo**(`page`): `void` Defined in: [core/src/book.ts:44](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L44) Instant turns. #### Parameters [Section titled “Parameters”](#parameters-4) ##### page [Section titled “page”](#page-2) `number` #### Returns [Section titled “Returns”](#returns-8) `void` *** ### update() [Section titled “update()”](#update) > **update**(): `void` Defined in: [core/src/book.ts:51](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L51) Re-measure the container and redraw. Resizes are handled automatically; call this after other layout changes. #### Returns [Section titled “Returns”](#returns-9) `void` # BookEvents > **BookEvents** = `object` Defined in: [core/src/book.ts:17](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L17) ## Properties [Section titled “Properties”](#properties) ### changeOrientation [Section titled “changeOrientation”](#changeorientation) > **changeOrientation**: `object` Defined in: [core/src/book.ts:25](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L25) #### orientation [Section titled “orientation”](#orientation) > `readonly` **orientation**: [`Orientation`](/api/openpageflip/core/type-aliases/orientation/) *** ### changeState [Section titled “changeState”](#changestate) > **changeState**: `object` Defined in: [core/src/book.ts:24](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L24) #### state [Section titled “state”](#state) > `readonly` **state**: [`FlipState`](/api/openpageflip/core/type-aliases/flipstate/) *** ### flip [Section titled “flip”](#flip) > **flip**: `object` Defined in: [core/src/book.ts:23](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L23) A different spread is showing. `page` is the first page of it. #### page [Section titled “page”](#page) > `readonly` **page**: `number` *** ### init [Section titled “init”](#init) > **init**: `object` Defined in: [core/src/book.ts:19](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L19) The book is laid out and showing `startPage`. Fires once, after `createBook` returns. #### orientation [Section titled “orientation”](#orientation-1) > `readonly` **orientation**: [`Orientation`](/api/openpageflip/core/type-aliases/orientation/) #### page [Section titled “page”](#page-1) > `readonly` **page**: `number` *** ### update [Section titled “update”](#update) > **update**: `object` Defined in: [core/src/book.ts:21](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L21) Pages were replaced with `setPages`. #### orientation [Section titled “orientation”](#orientation-2) > `readonly` **orientation**: [`Orientation`](/api/openpageflip/core/type-aliases/orientation/) #### page [Section titled “page”](#page-2) > `readonly` **page**: `number` # BookOptions > **BookOptions** = `object` Defined in: [core/src/options.ts:52](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L52) ## Properties [Section titled “Properties”](#properties) ### autoSize? [Section titled “autoSize?”](#autosize) > `readonly` `optional` **autoSize?**: `boolean` Defined in: [core/src/options.ts:78](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L78) Size the container to the book (aspect ratio and max width). #### Default [Section titled “Default”](#default) ```ts true ``` *** ### click? [Section titled “click?”](#click) > `readonly` `optional` **click?**: [`ClickMode`](/api/openpageflip/core/type-aliases/clickmode/) Defined in: [core/src/options.ts:80](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L80) #### Default [Section titled “Default”](#default-1) ```ts "anywhere" ``` *** ### cover? [Section titled “cover?”](#cover) > `readonly` `optional` **cover?**: `boolean` Defined in: [core/src/options.ts:66](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L66) Show the first and last pages alone, as hard covers. #### Default [Section titled “Default”](#default-2) ```ts false ``` *** ### drag? [Section titled “drag?”](#drag) > `readonly` `optional` **drag?**: `boolean` Defined in: [core/src/options.ts:82](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L82) Let the pointer drag a corner. #### Default [Section titled “Default”](#default-3) ```ts true ``` *** ### easing? [Section titled “easing?”](#easing) > `readonly` `optional` **easing?**: (`t`) => `number` Defined in: [core/src/options.ts:72](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L72) Easing for the corner’s path, `t` in 0..1. #### Parameters [Section titled “Parameters”](#parameters) ##### t [Section titled “t”](#t) `number` #### Returns [Section titled “Returns”](#returns) `number` #### Default [Section titled “Default”](#default-4) ```ts linear ``` *** ### flipDuration? [Section titled “flipDuration?”](#flipduration) > `readonly` `optional` **flipDuration?**: `number` Defined in: [core/src/options.ts:70](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L70) Duration of a full flip in milliseconds. Shorter flips take proportionally less. #### Default [Section titled “Default”](#default-5) ```ts 1000 ``` *** ### height [Section titled “height”](#height) > `readonly` **height**: `number` Defined in: [core/src/options.ts:56](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L56) Base page height in CSS pixels. *** ### hoverCorners? [Section titled “hoverCorners?”](#hovercorners) > `readonly` `optional` **hoverCorners?**: `boolean` Defined in: [core/src/options.ts:88](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L88) Lift a corner when the mouse hovers over it. #### Default [Section titled “Default”](#default-6) ```ts true ``` *** ### ignoreDragOn? [Section titled “ignoreDragOn?”](#ignoredragon) > `readonly` `optional` **ignoreDragOn?**: `string` | `false` Defined in: [core/src/options.ts:94](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L94) Pointer events starting on an element matching this selector never start a flip. `false` turns this off. #### Default [Section titled “Default”](#default-7) ```ts "a, button, input, textarea, select, [data-opf-no-flip]" ``` *** ### layout? [Section titled “layout?”](#layout) > `readonly` `optional` **layout?**: [`Layout`](/api/openpageflip/core/type-aliases/layout/) Defined in: [core/src/options.ts:64](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L64) #### Default [Section titled “Default”](#default-8) ```ts "auto" ``` *** ### maxWidth? [Section titled “maxWidth?”](#maxwidth) > `readonly` `optional` **maxWidth?**: `number` Defined in: [core/src/options.ts:62](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L62) Widest single page in `stretch` mode. #### Default [Section titled “Default”](#default-9) ```ts 2000 ``` *** ### minWidth? [Section titled “minWidth?”](#minwidth) > `readonly` `optional` **minWidth?**: `number` Defined in: [core/src/options.ts:60](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L60) Narrowest single page in `stretch` mode; below twice this the book goes portrait. #### Default [Section titled “Default”](#default-10) ```ts 100 ``` *** ### pages? [Section titled “pages?”](#pages) > `readonly` `optional` **pages?**: `Iterable`<`HTMLElement`> Defined in: [core/src/options.ts:96](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L96) Page elements. #### Default [Section titled “Default”](#default-11) ```ts the container's children ``` *** ### shadowOpacity? [Section titled “shadowOpacity?”](#shadowopacity) > `readonly` `optional` **shadowOpacity?**: `number` Defined in: [core/src/options.ts:76](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L76) 0 hides shadows, 1 is full strength. #### Default [Section titled “Default”](#default-12) ```ts 1 ``` *** ### shadows? [Section titled “shadows?”](#shadows) > `readonly` `optional` **shadows?**: `boolean` Defined in: [core/src/options.ts:74](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L74) #### Default [Section titled “Default”](#default-13) ```ts true ``` *** ### size? [Section titled “size?”](#size) > `readonly` `optional` **size?**: [`SizeMode`](/api/openpageflip/core/type-aliases/sizemode/) Defined in: [core/src/options.ts:58](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L58) #### Default [Section titled “Default”](#default-14) ```ts "fixed" ``` *** ### startPage? [Section titled “startPage?”](#startpage) > `readonly` `optional` **startPage?**: `number` Defined in: [core/src/options.ts:68](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L68) Zero-based page to open on. #### Default [Section titled “Default”](#default-15) ```ts 0 ``` *** ### swipe? [Section titled “swipe?”](#swipe) > `readonly` `optional` **swipe?**: `boolean` Defined in: [core/src/options.ts:84](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L84) Turn the page on a quick horizontal swipe. #### Default [Section titled “Default”](#default-16) ```ts true ``` *** ### swipeDistance? [Section titled “swipeDistance?”](#swipedistance) > `readonly` `optional` **swipeDistance?**: `number` Defined in: [core/src/options.ts:86](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L86) Minimum swipe travel in CSS pixels. #### Default [Section titled “Default”](#default-17) ```ts 30 ``` *** ### width [Section titled “width”](#width) > `readonly` **width**: `number` Defined in: [core/src/options.ts:54](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L54) Base page width in CSS pixels. With `size: "stretch"` only the `width:height` ratio matters. # BookRect > **BookRect** = `object` Defined in: [core/src/layout.ts:4](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L4) Where the book sits inside its container, in container CSS pixels. ## Properties [Section titled “Properties”](#properties) ### height [Section titled “height”](#height) > `readonly` **height**: `number` Defined in: [core/src/layout.ts:9](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L9) *** ### left [Section titled “left”](#left) > `readonly` **left**: `number` Defined in: [core/src/layout.ts:5](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L5) *** ### pageWidth [Section titled “pageWidth”](#pagewidth) > `readonly` **pageWidth**: `number` Defined in: [core/src/layout.ts:10](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L10) *** ### top [Section titled “top”](#top) > `readonly` **top**: `number` Defined in: [core/src/layout.ts:6](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L6) *** ### width [Section titled “width”](#width) > `readonly` **width**: `number` Defined in: [core/src/layout.ts:8](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L8) Always two pages wide, even in portrait, where only the right half is visible. # ClickMode > **ClickMode** = *typeof* [`ClickMode`](/api/openpageflip/core/variables/clickmode/)\[keyof *typeof* [`ClickMode`](/api/openpageflip/core/variables/clickmode/)] Defined in: [core/src/options.ts:49](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L49) When a click or tap turns the page. # Clock > **Clock** = `object` Defined in: [core/src/animation.ts:2](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/animation.ts#L2) Time and frame sources, injectable so tests can step animations by hand. ## Methods [Section titled “Methods”](#methods) ### cancelFrame() [Section titled “cancelFrame()”](#cancelframe) > **cancelFrame**(`handle`): `void` Defined in: [core/src/animation.ts:5](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/animation.ts#L5) #### Parameters [Section titled “Parameters”](#parameters) ##### handle [Section titled “handle”](#handle) `number` #### Returns [Section titled “Returns”](#returns) `void` *** ### now() [Section titled “now()”](#now) > **now**(): `number` Defined in: [core/src/animation.ts:3](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/animation.ts#L3) #### Returns [Section titled “Returns”](#returns-1) `number` *** ### requestFrame() [Section titled “requestFrame()”](#requestframe) > **requestFrame**(`callback`): `number` Defined in: [core/src/animation.ts:4](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/animation.ts#L4) #### Parameters [Section titled “Parameters”](#parameters-1) ##### callback [Section titled “callback”](#callback) (`time`) => `void` #### Returns [Section titled “Returns”](#returns-2) `number` # CreateBookOptions > **CreateBookOptions** = [`BookOptions`](/api/openpageflip/core/type-aliases/bookoptions/) & `object` Defined in: [core/src/book.ts:58](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/book.ts#L58) ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### clock? [Section titled “clock?”](#clock) > `readonly` `optional` **clock?**: [`Clock`](/api/openpageflip/core/type-aliases/clock/) Time and frame source, replaceable in tests. # Emitter > **Emitter**<`Events`> = `object` Defined in: [core/src/events.ts:3](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/events.ts#L3) ## Type Parameters [Section titled “Type Parameters”](#type-parameters) ### Events [Section titled “Events”](#events) `Events` *extends* `Record`<`string`, `unknown`> ## Methods [Section titled “Methods”](#methods) ### clear() [Section titled “clear()”](#clear) > **clear**(): `void` Defined in: [core/src/events.ts:11](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/events.ts#L11) #### Returns [Section titled “Returns”](#returns) `void` *** ### emit() [Section titled “emit()”](#emit) > **emit**<`K`>(`name`, `event`): `void` Defined in: [core/src/events.ts:10](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/events.ts#L10) #### Type Parameters [Section titled “Type Parameters”](#type-parameters-1) ##### K [Section titled “K”](#k) `K` *extends* `string` | `number` | `symbol` #### Parameters [Section titled “Parameters”](#parameters) ##### name [Section titled “name”](#name) `K` ##### event [Section titled “event”](#event) `Events`\[`K`] #### Returns [Section titled “Returns”](#returns-1) `void` *** ### off() [Section titled “off()”](#off) > **off**<`K`>(`name`, `listener`): `void` Defined in: [core/src/events.ts:9](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/events.ts#L9) #### Type Parameters [Section titled “Type Parameters”](#type-parameters-2) ##### K [Section titled “K”](#k-1) `K` *extends* `string` | `number` | `symbol` #### Parameters [Section titled “Parameters”](#parameters-1) ##### name [Section titled “name”](#name-1) `K` ##### listener [Section titled “listener”](#listener) [`Listener`](/api/openpageflip/core/type-aliases/listener/)<`Events`\[`K`]> #### Returns [Section titled “Returns”](#returns-2) `void` *** ### on() [Section titled “on()”](#on) > **on**<`K`>(`name`, `listener`, `options?`): () => `void` Defined in: [core/src/events.ts:4](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/events.ts#L4) #### Type Parameters [Section titled “Type Parameters”](#type-parameters-3) ##### K [Section titled “K”](#k-2) `K` *extends* `string` | `number` | `symbol` #### Parameters [Section titled “Parameters”](#parameters-2) ##### name [Section titled “name”](#name-2) `K` ##### listener [Section titled “listener”](#listener-1) [`Listener`](/api/openpageflip/core/type-aliases/listener/)<`Events`\[`K`]> ##### options? [Section titled “options?”](#options) ###### signal? [Section titled “signal?”](#signal) `AbortSignal` #### Returns [Section titled “Returns”](#returns-3) () => `void` # FlipCorner > **FlipCorner** = *typeof* [`FlipCorner`](/api/openpageflip/core/variables/flipcorner/)\[keyof *typeof* [`FlipCorner`](/api/openpageflip/core/variables/flipcorner/)] Defined in: [core/src/options.ts:11](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L11) Which corner a programmatic flip lifts. # FlipDirection > **FlipDirection** = *typeof* [`FlipDirection`](/api/openpageflip/core/variables/flipdirection/)\[keyof *typeof* [`FlipDirection`](/api/openpageflip/core/variables/flipdirection/)] Defined in: [core/src/options.ts:19](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L19) Which way a page is turning: `forward` reads on, `back` returns to the previous spread. # FlipFrame > **FlipFrame** = `object` Defined in: [core/src/controller.ts:40](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L40) ## Properties [Section titled “Properties”](#properties) ### bottom [Section titled “bottom”](#bottom) > `readonly` **bottom**: `number` Defined in: [core/src/controller.ts:44](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L44) *** ### corner [Section titled “corner”](#corner) > `readonly` **corner**: [`FlipCorner`](/api/openpageflip/core/type-aliases/flipcorner/) Defined in: [core/src/controller.ts:42](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L42) *** ### direction [Section titled “direction”](#direction) > `readonly` **direction**: [`FlipDirection`](/api/openpageflip/core/type-aliases/flipdirection/) Defined in: [core/src/controller.ts:41](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L41) *** ### flipping [Section titled “flipping”](#flipping) > `readonly` **flipping**: `number` Defined in: [core/src/controller.ts:43](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L43) *** ### fold [Section titled “fold”](#fold) > `readonly` **fold**: [`Fold`](/api/openpageflip/core/type-aliases/fold/) Defined in: [core/src/controller.ts:45](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L45) *** ### hardAngle [Section titled “hardAngle”](#hardangle) > `readonly` **hardAngle**: `number` Defined in: [core/src/controller.ts:48](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L48) Rotation about the spine for hard pages, in degrees. *** ### progress [Section titled “progress”](#progress) > `readonly` **progress**: `number` Defined in: [core/src/controller.ts:46](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L46) *** ### shadow [Section titled “shadow”](#shadow) > `readonly` **shadow**: [`ShadowData`](/api/openpageflip/core/type-aliases/shadowdata/) | `null` Defined in: [core/src/controller.ts:49](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L49) # FlipState > **FlipState** = *typeof* [`FlipState`](/api/openpageflip/core/variables/flipstate/)\[keyof *typeof* [`FlipState`](/api/openpageflip/core/variables/flipstate/)] Defined in: [core/src/options.ts:27](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L27) What the book is doing right now. # Fold > **Fold** = `object` Defined in: [core/src/geometry/fold.ts:40](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L40) ## Properties [Section titled “Properties”](#properties) ### activeCorner [Section titled “activeCorner”](#activecorner) > `readonly` **activeCorner**: [`Point`](/api/openpageflip/core/type-aliases/point/) Defined in: [core/src/geometry/fold.ts:55](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L55) Where the flipping page’s own origin corner sits. *** ### angle [Section titled “angle”](#angle) > `readonly` **angle**: `number` Defined in: [core/src/geometry/fold.ts:42](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L42) Rotation of the flipping page in radians, signed by direction. *** ### bottomClip [Section titled “bottomClip”](#bottomclip) > `readonly` **bottomClip**: readonly [`Point`](/api/openpageflip/core/type-aliases/point/)\[] Defined in: [core/src/geometry/fold.ts:53](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L53) Part of the page underneath that the fold reveals. *** ### bottomPagePosition [Section titled “bottomPagePosition”](#bottompageposition) > `readonly` **bottomPagePosition**: [`Point`](/api/openpageflip/core/type-aliases/point/) Defined in: [core/src/geometry/fold.ts:56](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L56) *** ### flippingClip [Section titled “flippingClip”](#flippingclip) > `readonly` **flippingClip**: readonly [`Point`](/api/openpageflip/core/type-aliases/point/)\[] Defined in: [core/src/geometry/fold.ts:51](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L51) Visible part of the flipping page, as a polygon in page coordinates. *** ### intersections [Section titled “intersections”](#intersections) > `readonly` **intersections**: [`FoldIntersections`](/api/openpageflip/core/type-aliases/foldintersections/) Defined in: [core/src/geometry/fold.ts:49](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L49) *** ### position [Section titled “position”](#position) > `readonly` **position**: [`Point`](/api/openpageflip/core/type-aliases/point/) Defined in: [core/src/geometry/fold.ts:44](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L44) Where the dragged corner ended up after clamping to what paper can do. *** ### progress [Section titled “progress”](#progress) > `readonly` **progress**: `number` Defined in: [core/src/geometry/fold.ts:46](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L46) 0 at rest, 100 fully turned. *** ### rect [Section titled “rect”](#rect) > `readonly` **rect**: [`RectPoints`](/api/openpageflip/core/type-aliases/rectpoints/) Defined in: [core/src/geometry/fold.ts:48](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L48) Corners of the flipping page after rotation. *** ### shadow [Section titled “shadow”](#shadow) > `readonly` **shadow**: { `angle`: `number`; `start`: [`Point`](/api/openpageflip/core/type-aliases/point/); } | `null` Defined in: [core/src/geometry/fold.ts:58](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L58) Drop-shadow origin and rotation, or `null` when the fold crosses no usable edges. # FoldInput > **FoldInput** = `object` Defined in: [core/src/geometry/fold.ts:24](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L24) ## Properties [Section titled “Properties”](#properties) ### corner [Section titled “corner”](#corner) > `readonly` **corner**: [`FlipCorner`](/api/openpageflip/core/type-aliases/flipcorner/) Defined in: [core/src/geometry/fold.ts:26](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L26) *** ### direction [Section titled “direction”](#direction) > `readonly` **direction**: [`FlipDirection`](/api/openpageflip/core/type-aliases/flipdirection/) Defined in: [core/src/geometry/fold.ts:25](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L25) *** ### pageHeight [Section titled “pageHeight”](#pageheight) > `readonly` **pageHeight**: `number` Defined in: [core/src/geometry/fold.ts:28](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L28) *** ### pageWidth [Section titled “pageWidth”](#pagewidth) > `readonly` **pageWidth**: `number` Defined in: [core/src/geometry/fold.ts:27](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L27) *** ### point [Section titled “point”](#point) > `readonly` **point**: [`Point`](/api/openpageflip/core/type-aliases/point/) Defined in: [core/src/geometry/fold.ts:30](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L30) Drag point in active-page coordinates: origin at the page’s top-left, x grows toward the outer edge. # FoldIntersections > **FoldIntersections** = `object` Defined in: [core/src/geometry/fold.ts:34](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L34) Where the fold line meets the page edges. A `null` edge is not crossed. ## Properties [Section titled “Properties”](#properties) ### bottom [Section titled “bottom”](#bottom) > `readonly` **bottom**: [`Point`](/api/openpageflip/core/type-aliases/point/) | `null` Defined in: [core/src/geometry/fold.ts:37](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L37) *** ### side [Section titled “side”](#side) > `readonly` **side**: [`Point`](/api/openpageflip/core/type-aliases/point/) | `null` Defined in: [core/src/geometry/fold.ts:36](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L36) *** ### top [Section titled “top”](#top) > `readonly` **top**: [`Point`](/api/openpageflip/core/type-aliases/point/) | `null` Defined in: [core/src/geometry/fold.ts:35](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/fold.ts#L35) # Frame > **Frame** = `object` Defined in: [core/src/controller.ts:53](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L53) Everything a renderer needs to draw one moment of the book. ## Properties [Section titled “Properties”](#properties) ### flip [Section titled “flip”](#flip) > `readonly` **flip**: [`FlipFrame`](/api/openpageflip/core/type-aliases/flipframe/) | `null` Defined in: [core/src/controller.ts:58](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L58) *** ### left [Section titled “left”](#left) > `readonly` **left**: `number` | `null` Defined in: [core/src/controller.ts:56](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L56) *** ### orientation [Section titled “orientation”](#orientation) > `readonly` **orientation**: [`Orientation`](/api/openpageflip/core/type-aliases/orientation/) Defined in: [core/src/controller.ts:55](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L55) *** ### rect [Section titled “rect”](#rect) > `readonly` **rect**: [`BookRect`](/api/openpageflip/core/type-aliases/bookrect/) Defined in: [core/src/controller.ts:54](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L54) *** ### right [Section titled “right”](#right) > `readonly` **right**: `number` | `null` Defined in: [core/src/controller.ts:57](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L57) # Layout > **Layout** = *typeof* [`Layout`](/api/openpageflip/core/variables/layout/)\[keyof *typeof* [`Layout`](/api/openpageflip/core/variables/layout/)] Defined in: [core/src/options.ts:7](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L7) How many pages are visible at once. `auto` picks by container width. # LayoutOptions > **LayoutOptions** = `Pick`<[`ResolvedOptions`](/api/openpageflip/core/type-aliases/resolvedoptions/), `"size"` | `"width"` | `"height"` | `"minWidth"` | `"maxWidth"` | `"layout"`> Defined in: [core/src/layout.ts:15](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L15) # LayoutResult > **LayoutResult** = `object` Defined in: [core/src/layout.ts:13](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L13) ## Properties [Section titled “Properties”](#properties) ### orientation [Section titled “orientation”](#orientation) > `readonly` **orientation**: [`Orientation`](/api/openpageflip/core/type-aliases/orientation/) Defined in: [core/src/layout.ts:13](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L13) *** ### rect [Section titled “rect”](#rect) > `readonly` **rect**: [`BookRect`](/api/openpageflip/core/type-aliases/bookrect/) Defined in: [core/src/layout.ts:13](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/layout.ts#L13) # Listener > **Listener**<`T`> = (`event`) => `void` Defined in: [core/src/events.ts:1](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/events.ts#L1) ## Type Parameters [Section titled “Type Parameters”](#type-parameters) ### T [Section titled “T”](#t) `T` ## Parameters [Section titled “Parameters”](#parameters) ### event [Section titled “event”](#event) `T` ## Returns [Section titled “Returns”](#returns) `void` # Orientation > **Orientation** = *typeof* [`Orientation`](/api/openpageflip/core/variables/orientation/)\[keyof *typeof* [`Orientation`](/api/openpageflip/core/variables/orientation/)] Defined in: [core/src/options.ts:23](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L23) What the book is showing: one page (`portrait`) or a two-page spread (`landscape`). # PageDensity > **PageDensity** = *typeof* [`PageDensity`](/api/openpageflip/core/variables/pagedensity/)\[keyof *typeof* [`PageDensity`](/api/openpageflip/core/variables/pagedensity/)] Defined in: [core/src/options.ts:15](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L15) `hard` pages rotate as a rigid sheet (covers); `soft` pages bend along the fold. # Point > **Point** = `object` Defined in: [core/src/geometry/point.ts:9](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L9) Plane geometry primitives for the fold calculation. Pure functions, no DOM. The maths derives from StPageFlip’s `Helper` (MIT, Oleg Litovski). Where the original’s behaviour is quirky, the quirk is kept and commented, because the renderer’s look depends on it and the parity tests in `test/fold.parity.test.ts` hold this module to the original. ## Properties [Section titled “Properties”](#properties) ### x [Section titled “x”](#x) > `readonly` **x**: `number` Defined in: [core/src/geometry/point.ts:9](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L9) *** ### y [Section titled “y”](#y) > `readonly` **y**: `number` Defined in: [core/src/geometry/point.ts:9](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L9) # Rect > **Rect** = `object` Defined in: [core/src/geometry/point.ts:14](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L14) ## Properties [Section titled “Properties”](#properties) ### height [Section titled “height”](#height) > `readonly` **height**: `number` Defined in: [core/src/geometry/point.ts:18](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L18) *** ### left [Section titled “left”](#left) > `readonly` **left**: `number` Defined in: [core/src/geometry/point.ts:15](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L15) *** ### top [Section titled “top”](#top) > `readonly` **top**: `number` Defined in: [core/src/geometry/point.ts:16](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L16) *** ### width [Section titled “width”](#width) > `readonly` **width**: `number` Defined in: [core/src/geometry/point.ts:17](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L17) # RectPoints > **RectPoints** = `object` Defined in: [core/src/geometry/point.ts:22](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L22) The four corners of a rectangle after rotation, so no longer axis-aligned. ## Properties [Section titled “Properties”](#properties) ### bottomLeft [Section titled “bottomLeft”](#bottomleft) > `readonly` **bottomLeft**: [`Point`](/api/openpageflip/core/type-aliases/point/) Defined in: [core/src/geometry/point.ts:25](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L25) *** ### bottomRight [Section titled “bottomRight”](#bottomright) > `readonly` **bottomRight**: [`Point`](/api/openpageflip/core/type-aliases/point/) Defined in: [core/src/geometry/point.ts:26](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L26) *** ### topLeft [Section titled “topLeft”](#topleft) > `readonly` **topLeft**: [`Point`](/api/openpageflip/core/type-aliases/point/) Defined in: [core/src/geometry/point.ts:23](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L23) *** ### topRight [Section titled “topRight”](#topright) > `readonly` **topRight**: [`Point`](/api/openpageflip/core/type-aliases/point/) Defined in: [core/src/geometry/point.ts:24](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L24) # ResolvedOptions > **ResolvedOptions** = `Required`<`Omit`<[`BookOptions`](/api/openpageflip/core/type-aliases/bookoptions/), `"pages"`>> Defined in: [core/src/options.ts:99](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L99) # Segment > **Segment** = readonly \[[`Point`](/api/openpageflip/core/type-aliases/point/), [`Point`](/api/openpageflip/core/type-aliases/point/)] Defined in: [core/src/geometry/point.ts:12](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/geometry/point.ts#L12) A line through two points. Used as an infinite line, not a bounded segment. # ShadowData > **ShadowData** = `object` Defined in: [core/src/controller.ts:30](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L30) ## Properties [Section titled “Properties”](#properties) ### angle [Section titled “angle”](#angle) > `readonly` **angle**: `number` Defined in: [core/src/controller.ts:32](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L32) *** ### direction [Section titled “direction”](#direction) > `readonly` **direction**: [`FlipDirection`](/api/openpageflip/core/type-aliases/flipdirection/) Defined in: [core/src/controller.ts:35](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L35) *** ### opacity [Section titled “opacity”](#opacity) > `readonly` **opacity**: `number` Defined in: [core/src/controller.ts:34](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L34) *** ### pos [Section titled “pos”](#pos) > `readonly` **pos**: [`Point`](/api/openpageflip/core/type-aliases/point/) Defined in: [core/src/controller.ts:31](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L31) *** ### progress [Section titled “progress”](#progress) > `readonly` **progress**: `number` Defined in: [core/src/controller.ts:37](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L37) 0..200: the original doubled flip progress for its hard-page shadow curve. *** ### width [Section titled “width”](#width) > `readonly` **width**: `number` Defined in: [core/src/controller.ts:33](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/controller.ts#L33) # SizeMode > **SizeMode** = *typeof* [`SizeMode`](/api/openpageflip/core/variables/sizemode/)\[keyof *typeof* [`SizeMode`](/api/openpageflip/core/variables/sizemode/)] Defined in: [core/src/options.ts:40](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L40) How the book sizes itself. # ClickMode > `const` **ClickMode**: `object` Defined in: [core/src/options.ts:49](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L49) When a click or tap turns the page. ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### anywhere [Section titled “anywhere”](#anywhere) > `readonly` **anywhere**: `"anywhere"` = `"anywhere"` ### corners [Section titled “corners”](#corners) > `readonly` **corners**: `"corners"` = `"corners"` ### off [Section titled “off”](#off) > `readonly` **off**: `"off"` = `"off"` # FlipCorner > `const` **FlipCorner**: `object` Defined in: [core/src/options.ts:11](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L11) Which corner a programmatic flip lifts. ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### bottom [Section titled “bottom”](#bottom) > `readonly` **bottom**: `"bottom"` = `"bottom"` ### top [Section titled “top”](#top) > `readonly` **top**: `"top"` = `"top"` # FlipDirection > `const` **FlipDirection**: `object` Defined in: [core/src/options.ts:19](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L19) Which way a page is turning: `forward` reads on, `back` returns to the previous spread. ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### back [Section titled “back”](#back) > `readonly` **back**: `"back"` = `"back"` ### forward [Section titled “forward”](#forward) > `readonly` **forward**: `"forward"` = `"forward"` # FlipState > `const` **FlipState**: `object` Defined in: [core/src/options.ts:27](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L27) What the book is doing right now. ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### flipping [Section titled “flipping”](#flipping) > `readonly` **flipping**: `"flipping"` = `"flipping"` A flip animation is running. ### foldCorner [Section titled “foldCorner”](#foldcorner) > `readonly` **foldCorner**: `"fold_corner"` = `"fold_corner"` A corner is lifted because the pointer hovers over it. ### read [Section titled “read”](#read) > `readonly` **read**: `"read"` = `"read"` Nothing in motion. ### userFold [Section titled “userFold”](#userfold) > `readonly` **userFold**: `"user_fold"` = `"user_fold"` The user is dragging a corner. # Layout > `const` **Layout**: `object` Defined in: [core/src/options.ts:7](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L7) How many pages are visible at once. `auto` picks by container width. ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### auto [Section titled “auto”](#auto) > `readonly` **auto**: `"auto"` = `"auto"` ### single [Section titled “single”](#single) > `readonly` **single**: `"single"` = `"single"` ### spread [Section titled “spread”](#spread) > `readonly` **spread**: `"spread"` = `"spread"` # Orientation > `const` **Orientation**: `object` Defined in: [core/src/options.ts:23](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L23) What the book is showing: one page (`portrait`) or a two-page spread (`landscape`). ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### landscape [Section titled “landscape”](#landscape) > `readonly` **landscape**: `"landscape"` = `"landscape"` ### portrait [Section titled “portrait”](#portrait) > `readonly` **portrait**: `"portrait"` = `"portrait"` # PageDensity > `const` **PageDensity**: `object` Defined in: [core/src/options.ts:15](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L15) `hard` pages rotate as a rigid sheet (covers); `soft` pages bend along the fold. ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### hard [Section titled “hard”](#hard) > `readonly` **hard**: `"hard"` = `"hard"` ### soft [Section titled “soft”](#soft) > `readonly` **soft**: `"soft"` = `"soft"` # SizeMode > `const` **SizeMode**: `object` Defined in: [core/src/options.ts:40](https://github.com/benhonda/openpageflip/blob/main/packages/core/src/options.ts#L40) How the book sizes itself. ## Type Declaration [Section titled “Type Declaration”](#type-declaration) ### fixed [Section titled “fixed”](#fixed) > `readonly` **fixed**: `"fixed"` = `"fixed"` Pages are exactly `width` x `height` CSS pixels. ### stretch [Section titled “stretch”](#stretch) > `readonly` **stretch**: `"stretch"` = `"stretch"` Pages scale to the container, keeping the `width:height` ratio, between `minWidth` and `maxWidth`. # @openpageflip/react React 19 bindings: `FlipBook`, `Page`, and the core types they use. ## Type Aliases [Section titled “Type Aliases”](#type-aliases) * [FlipBookEventProps](/api/openpageflip/react/type-aliases/flipbookeventprops/) * [FlipBookProps](/api/openpageflip/react/type-aliases/flipbookprops/) * [PageProps](/api/openpageflip/react/type-aliases/pageprops/) ## Functions [Section titled “Functions”](#functions) * [FlipBook](/api/openpageflip/react/functions/flipbook/) * [Page](/api/openpageflip/react/functions/page/) ## References [Section titled “References”](#references) ### Book [Section titled “Book”](#book) Re-exports [Book](/api/openpageflip/core/type-aliases/book/) *** ### BookEvents [Section titled “BookEvents”](#bookevents) Re-exports [BookEvents](/api/openpageflip/core/type-aliases/bookevents/) *** ### BookOptions [Section titled “BookOptions”](#bookoptions) Re-exports [BookOptions](/api/openpageflip/core/type-aliases/bookoptions/) *** ### BookRect [Section titled “BookRect”](#bookrect) Re-exports [BookRect](/api/openpageflip/core/type-aliases/bookrect/) *** ### FlipCorner [Section titled “FlipCorner”](#flipcorner) Re-exports [FlipCorner](/api/openpageflip/core/variables/flipcorner/) *** ### FlipState [Section titled “FlipState”](#flipstate) Re-exports [FlipState](/api/openpageflip/core/variables/flipstate/) *** ### Layout [Section titled “Layout”](#layout) Re-exports [Layout](/api/openpageflip/core/variables/layout/) *** ### Orientation [Section titled “Orientation”](#orientation) Re-exports [Orientation](/api/openpageflip/core/variables/orientation/) *** ### PageDensity [Section titled “PageDensity”](#pagedensity) Re-exports [PageDensity](/api/openpageflip/core/variables/pagedensity/) # FlipBook > **FlipBook**(`__namedParameters`): `ReactElement` Defined in: [react/src/FlipBook.tsx:67](https://github.com/benhonda/openpageflip/blob/main/packages/react/src/FlipBook.tsx#L67) ## Parameters [Section titled “Parameters”](#parameters) ### \_\_namedParameters [Section titled “\_\_namedParameters”](#__namedparameters) [`FlipBookProps`](/api/openpageflip/react/type-aliases/flipbookprops/) ## Returns [Section titled “Returns”](#returns) `ReactElement` # Page > **Page**(`__namedParameters`): `ReactElement` Defined in: [react/src/Page.tsx:14](https://github.com/benhonda/openpageflip/blob/main/packages/react/src/Page.tsx#L14) One page of a `FlipBook`. Any child of `FlipBook` becomes a page; `Page` is the way to say which are hard and to put a class or style on the page element itself. ## Parameters [Section titled “Parameters”](#parameters) ### \_\_namedParameters [Section titled “\_\_namedParameters”](#__namedparameters) [`PageProps`](/api/openpageflip/react/type-aliases/pageprops/) ## Returns [Section titled “Returns”](#returns) `ReactElement` # FlipBookEventProps > **FlipBookEventProps** = ``{ [K in keyof BookEvents as `on${Capitalize