@atomico/storybook

Improves the generation of stories in Storybook.

This package has 2 main objectives:

  1. Render as stories webcomponents created with Atomico using JSX/TSX within Storybook

  2. Facilitate and automate the generation of stories.

Render as stories webcomponents created with Atomico using JSX/TSX within Storybook.

@atomico/storybook has a decorator that allows Storybook to render the JSX/TSX of webcomponents created with Atomico.

Config

The following configuration can be added per story or in the .storybook/preview.js file:

import { decorator } from "@atomico/storybook";

export const decorators = [decorator()];

Facilitate and automate the generation of stories.

@atomico/storybook has the define function to infer from its webcomponent created with Atomico the configuration of the argTypes and args for Storybook, example:

import { define } from "@atomico/storybook";
import { MyComponent } from "./my-component";

export default {
    title: "Components/Card",
    ...define(MyComponent),
};

export const Default = (props)=><MyComponent {...props}/>

@atomico/storybook transforms its component's props into argTypes valid for Storybook.

You can also rewrite all or part of the configuration created by @atomico/storybook by giving the function define a second argument, example:

Last updated

Was this helpful?