@storybook/csf-plugin

Enrich CSF files via static analysis

  • Types
  • ESM
License
MIT
Install Size
7.4 kB(1.3 MB)
Vulns
0
Published

Get started

$npm install @storybook/csf-plugin
$pnpm add @storybook/csf-plugin
$yarn add @storybook/csf-plugin
$bun add @storybook/csf-plugin
$deno add npm:@storybook/csf-plugin
$vlt install @storybook/csf-plugin
$vp add @storybook/csf-plugin

Weekly DownloadsAcross all versions

Versions

View all versions
10.4.0
latest
8.2.10
tag-for-publishing-older-releases

Readme

CSF Plugin

The CSF plugin reads CSF files and enriches their content via static analysis. It supports Webpack, Vite, and other bundlers using unplugin.

Source snippets

CSF plugin can add static source snippets to each story. For example:

export const Basic = () => <Button />;

Would be transformed to:

export const Basic = () => <Button />;
Basic.parameters = {
  storySource: {
    source: '() => <Button />',
  },
  ...Basic.parameters,
};

This allows @storybook/addon-docs to display the static source snippet.

Learn more about Storybook at storybook.js.org.