@storybook/addon-decorator
TypeScript icon, indicating that this package has built-in type declarations

6.2.9 • Public • Published

example addon: decorator

This addon exposes a function users can use to wrap their storyFn with. This is called a decorator in storybook's terminology.

A decorator can perform analysis on the storyFn, detect how long it takes to render, detect side-effects, and have access to the storyContext.

It's also possible to wrap the results with some additional html/jsx or provide additional data to the storyFn.

Uses include:

  • do side-effects detection
  • wrap story with additional html
  • add data to storyFn

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @storybook/addon-decorator

    Weekly Downloads

    25

    Version

    6.2.9

    License

    MIT

    Unpacked Size

    5.66 kB

    Total Files

    17

    Last publish

    Collaborators

    • yannbf
    • kasperpeulen
    • valentinpalkovic
    • jreinhold
    • shilman
    • ndelangen
    • hypnosphi
    • tmeasday
    • igor-dv