npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gullabs/react-flipbook

v3.2.1

Published

React 18/19 binding for @gullabs/flipbook-core. Maintained fork of react-pageflip.

Readme

@gullabs/react-flipbook

React 18/19 binding for @gullabs/flipbook-core. Maintained fork of react-pageflip. License: MIT (engine dependency is MPL-2.0).

Full monorepo docs:

  • https://github.com/gul-labs/flipbook#readme
  • Migration from [email protected]: https://github.com/gul-labs/flipbook/blob/main/MIGRATION.md
  • Locked API surface: https://github.com/gul-labs/flipbook/blob/main/docs/API-CONTRACT.md
  • Live page faces (narration / highlight): https://github.com/gul-labs/flipbook/blob/main/docs/LIVE-PAGE-FACES.md
npm i @gullabs/react-flipbook
# pulls @gullabs/flipbook-core; react is a peer (>=18)

Quickstart

import { useState } from 'react';
import HTMLFlipBook, { type BookSnapshot } from '@gullabs/react-flipbook';

export function Book() {
  // Seed from onLoaded. onPageChange fires only for real turns, never on mount.
  const [book, setBook] = useState<{ page: number; pageCount: number } | null>(null);
  const sync = (s: BookSnapshot) => setBook({ page: s.page, pageCount: s.pageCount });

  return (
    <>
      <p>{book ? `Page ${book.page + 1} of ${book.pageCount}` : 'Loading…'}</p>
      <HTMLFlipBook width={300} height={500} onLoaded={sync} onPageChange={sync}>
        {/* Host element required. Style content on an INNER wrapper — the
            engine owns layout + paper on the leaf root. */}
        <div>
          <div style={{ height: '100%', padding: 16 }}>Page 1</div>
        </div>
        <div>
          <div style={{ height: '100%', padding: 16 }}>Page 2</div>
        </div>
      </HTMLFlipBook>
    </>
  );
}

First-hour rules

  1. onLoaded for the initial counteronPageChange / core flip do not fire on mount (only when the page index actually changes).
  2. Style an inner wrapper, not the leaf root. The engine writes position, size, clip, and paper onto the root every draw.
  3. Controlled page needs onPageChange — otherwise the engine turns and your prop snaps it back (a locked book).
  4. Do not drive initialPage from live URL state — it is a remount key. Freeze the deep link at mount, or use controlled page.

Common props and events

| Prop / event | Role | | ----------------------- | --------------------------------------------------------------------------- | | width / height | Required page size | | page + onPageChange | Controlled page (optional pageTransition: 'animate' | 'instant') | | onLoaded / onReady | Initial / once-per-engine snapshot (page, pageCount, visiblePages, …) | | onTurnProgress | Fold progress 0…1 while animating or dragging (silent on instant turns) | | onTurnRejected | Turn did not start (reason, direction, targetPage, landedOn) | | controls | 'auto' | 'visible' | 'none' | | hardCovers | Cover leaves shown alone, hard density | | pageBackground | Paper color (any CSS color; opacity is structural) | | injectStyles | Default true; set false under strict CSP and import core style.css |

Handle methods (refFlipBookHandle):

| Method | Role | | ----------------------- | --------------------------------------------------- | | flipNext / flipPrev | Animate relative turn (boolean) | | flipToPage(n) | Animate to page (boolean) | | turnToPage(n) | Instant jump (boolean) | | cancelTurn() | Abandon in-flight turn without committing | | destroy() | Tear down the engine and retire the React shell | | pageFlip() | Escape hatch → core PageFlip \| null |

Queries such as getPageCount / getVisiblePages live on the engine (pageFlip()?.getPageCount()) or on usePageFlip() state — not on the handle. Prefer destroy() on the handle over pageFlip()?.destroy(): the latter tears the engine down but does not retire the React shell until the next render.

License

MIT for this package. The engine (@gullabs/flipbook-core) is MPL-2.0 — see https://github.com/gul-labs/flipbook/blob/main/packages/core/LICENSE.

Copyright (c) 2026 Gul Labs.