interface / @typed/ui/Storybook

MountedStory

Live Storybook mount and its explicit asynchronous disposer.

Learn this UI primitive →

Package version
1.0.0-beta.13
Category
Story lifetime
Since
1.0.0

Import

import { MountedStory } from "@typed/ui/Storybook";

Signatures

export interface MountedStory {
    readonly canvas: HTMLDivElement;
    readonly dispose: () => Promise<void>;
}

Why

Stories need access to the actual canvas for assertions and deterministic teardown of a long-lived reactive render.

Ownership and lifetime

The mount owns its private Scope and render fiber. dispose interrupts the fiber and closes the Scope exactly once; callers own appending/removing the returned canvas. If the canvas is connected, disposal does not disconnect the removal observer; removing the canvas is the observer’s cleanup boundary.

Property: canvas

Detached div containing the story’s real rendered DOM.

Property: dispose

Idempotently closes rendering; remove a connected canvas to release its observer.

Source