NarraLeaf

Solutions

Complete patterns for UI, routing, saves, notifications, galleries, and migration.

Solutions combine the core story API with React UI. Each page starts from a working pattern and shows where to extend it.

Player UI

Pages and game features

Common questions

Is Game a global singleton?

No. useGame() returns the Game instance owned by the nearest GameProviders. Passing the same instance to multiple consumers shares state; separate providers may own separate games.

const game = useGame();
const liveGame = game.getLiveGame();

Does NarraLeaf include save slots?

NarraLeaf serializes and restores runtime state through liveGame.serialize() and liveGame.deserialize(). Your application chooses localStorage, IndexedDB, files, or a server and supplies the slot UI. See localStorage Saves.

Where does custom UI go?

Use Game configuration for dialog, menu, NVL, and notification slots. Put settings, history, gallery, and save pages inside Player using Page and Layout.

On this page