API Reference / @gtkx/storybook / @gtkx/storybook
@gtkx/storybook
Types and helpers for writing Storybook stories of GTK components and reusing them in tests.
Type Aliases
| Type Alias | Description |
|---|---|
| ActionCallback | A named story callback whose arguments can be recorded by the native explorer. |
| Args | Named values supplied to a story, including component props and custom render args. |
| ArgTypes | Explicit argument metadata used to configure native controls and named actions. |
| ComposedStories | Composed stories keyed by their original named exports. |
| ComposedStory | Renderable story with merged annotations; props override its composed default args. |
| Decorator | Wraps story content and can override args or globals when invoking the supplied Story function. |
| Meta | CSF3 default export metadata typed from a React component or an explicit args type. |
| Preview | Project annotations shared by all composed stories. |
| StoryContext | Composed story identity, args, and annotations available to render functions and decorators. |
| StoryContextUpdate | Values a decorator can override when invoking the decorated story. |
| StoryObj | CSF3 story object inferred from metadata, a React component, or an explicit args type. |
| StoryRender | Renders native React content from the current story args and composition context. |
Functions
| Function | Description |
|---|---|
| action | Creates a named action for a story's callback arguments. The explorer records bounded argument summaries; calls outside its action scope have no effect. |
| composeStories | Composes the selected CSF3 exports of a module into native React components. The default export supplies metadata; its includeStories and excludeStories select named exports. Returned keys retain the original export names. |
| composeStory | Composes a CSF3 story into a native React component with resolved defaults and decorators. Compose outside render to preserve component identity. Rendering props override the composed args. This function does not create an application, window, or Storybook preview lifecycle. |