docs/writing-docs/code-panel.mdx
Code Panel is a replacement for the Storysource addon, which was discontinued in Storybook 9.
</Callout>The Code panel renders a story’s source code when viewing that story in the canvas. Any args defined in the story are replaced with their values in the output.
To enable the Code panel, set parameters.docs.codePanel to true. For most projects, this is best done in the .storybook/preview.js|ts file, to apply to all stories.
You can also enable it at the component or story level:
<CodeSnippets path="code-panel-in-meta-and-story.md" />Code panel renders the same snippet as the Source docs block, which is also used in Autodocs pages. The snippet is customizable and reuses the Source configuration parameters.