Skip to content

Settings

Settings affecting the reader.

export type InputSettings = {
/**
* When two pages share the viewport: `auto` from the viewport's size and
* the book, `always` in every orientation, `never` one page at a time.
*/
spreadMode: `auto` | `always` | `never`
pageTurnAnimation: `none` | `fade` | `slide`
pageTurnAnimationDuration: undefined | number
/**
* Direction of page turning. This affect how the book
* is layout as well. This is useful to know this information
* when you want to have gesture which match the page direction
* for example.
*/
pageTurnDirection: `vertical` | `horizontal`
pageTurnMode: `controlled` | `scrollable`
snapAnimationDuration: number
navigationSnapThreshold:
| { type: "percentage"; value: number }
| { type: "pixels"; value: number }
numberOfAdjacentSpineItemToPreLoad: number
}
export type OutputSettings = InputSettings & {
computedPageTurnMode: "controlled" | "scrollable"
computedPageTurnDirection: "vertical" | "horizontal"
computedPageTurnAnimation: "none" | "fade" | "slide"
computedPageTurnAnimationDuration: number
}

spreadMode has no computed counterpart in the settings, because whether a spread is shown also depends on the viewport's size. The viewport resolves it in every layout, and reader.viewport.value.isSpread is what the reader shows. See Spread mode.

Observable<OutputSettings>

This observable emits as soon as you subscribe.