docs/_snippets/configure-mock-provider-with-story-parameter.md
import { Button } from './Button';
export default {
component: Button,
};
// Wrapped in light theme
export const Basic = {};
// Wrapped in dark theme
export const Dark = {
parameters: {
theme: 'dark',
},
};
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, nextjs-vite, etc.
import type { Meta, StoryObj } from '@storybook/your-framework';
import { Button } from './Button';
const meta = {
component: Button,
} satisfies Meta<typeof Button>;
export default meta;
type Story = StoryObj<typeof meta>;
// Wrapped in light theme
export const Basic: Story = {};
// Wrapped in dark theme
export const Dark: Story = {
parameters: {
theme: 'dark',
},
};
import preview from '../.storybook/preview';
import { Button } from './Button';
const meta = preview.meta({
component: Button,
});
// Wrapped in light theme
export const Basic = meta.story();
// Wrapped in dark theme
export const Dark = meta.story({
parameters: {
theme: 'dark',
},
});
import preview from '../.storybook/preview';
import { Button } from './Button';
const meta = preview.meta({
component: Button,
});
// Wrapped in light theme
export const Basic = meta.story();
// Wrapped in dark theme
export const Dark = meta.story({
parameters: {
theme: 'dark',
},
});