Skip to content

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 AliasDescription
ActionCallbackA named story callback whose arguments can be recorded by the native explorer.
ArgsNamed values supplied to a story, including component props and custom render args.
ArgTypesExplicit argument metadata used to configure native controls and named actions.
ComposedStoriesComposed stories keyed by their original named exports.
ComposedStoryRenderable story with merged annotations; props override its composed default args.
DecoratorWraps story content and can override args or globals when invoking the supplied Story function.
MetaCSF3 default export metadata typed from a React component or an explicit args type.
PreviewProject annotations shared by all composed stories.
StoryContextComposed story identity, args, and annotations available to render functions and decorators.
StoryContextUpdateValues a decorator can override when invoking the decorated story.
StoryObjCSF3 story object inferred from metadata, a React component, or an explicit args type.
StoryRenderRenders native React content from the current story args and composition context.

Functions ​

FunctionDescription
actionCreates a named action for a story's callback arguments. The explorer records bounded argument summaries; calls outside its action scope have no effect.
composeStoriesComposes 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.
composeStoryComposes 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.