@mihkeleidast/storybook-addon-source
Displays the source example of the current story
1,295,594
| Install | |
|---|---|
npm install @mihkeleidast/storybook-addon-source |
|
| Latest Version: | 1.0.1 |
| License: | MIT |
| Last Updated: | Mar 6, 2025 |
| Links: | GitHub · npm |
Maintainer: mihkeleidast
@mihkeleidast/storybook-addon-source
Installation
First, install the package.
npm install --save-dev @mihkeleidast/storybook-addon-source
Then, register it as an addon in .storybook/main.js.
// .storybook/main.ts
// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
import type { StorybookConfig } from '@storybook/your-framework';
const config: StorybookConfig = {
// ...rest of config
addons: [
'@storybook/addon-essentials'
'@mihkeleidast/storybook-addon-source', // 👈 register the addon here
],
};
export default config;
Then, add the decorator in .storybook/preview.js.
// .storybook/preview.ts
import { Preview } from "@storybook/react";
import { withJsx } from '../dist/index.js'
const preview: Preview = {
decorators: [
withJsx, // 👈 add the decorator as the first one
// ... rest of decorators
],
};
export default preview;
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 1.0.1 | MIT | |
| 1.0.0 | MIT |