docs/_snippets/addon-backgrounds-options-in-preview.md
export default {
parameters: {
backgrounds: {
options: {
// ๐ Default options
dark: { name: 'Dark', value: '#333' },
light: { name: 'Light', value: '#F7F9F2' },
// ๐ Add your own
maroon: { name: 'Maroon', value: '#400' },
},
},
},
initialGlobals: {
// ๐ Set the initial background color
backgrounds: { value: 'light' },
},
};
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
import type { Preview } from '@storybook/your-framework';
const preview: Preview = {
parameters: {
backgrounds: {
options: {
// ๐ Default options
dark: { name: 'Dark', value: '#333' },
light: { name: 'Light', value: '#F7F9F2' },
// ๐ Add your own
maroon: { name: 'Maroon', value: '#400' },
},
},
},
initialGlobals: {
// ๐ Set the initial background color
backgrounds: { value: 'light' },
},
};
export default preview;
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { definePreview } from '@storybook/your-framework';
export default definePreview({
parameters: {
backgrounds: {
options: {
// ๐ Default options
dark: { name: 'Dark', value: '#333' },
light: { name: 'Light', value: '#F7F9F2' },
// ๐ Add your own
maroon: { name: 'Maroon', value: '#400' },
},
},
},
initialGlobals: {
// ๐ Set the initial background color
backgrounds: { value: 'light' },
},
});
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { definePreview } from '@storybook/your-framework';
export default definePreview({
parameters: {
backgrounds: {
options: {
// ๐ Default options
dark: { name: 'Dark', value: '#333' },
light: { name: 'Light', value: '#F7F9F2' },
// ๐ Add your own
maroon: { name: 'Maroon', value: '#400' },
},
},
},
initialGlobals: {
// ๐ Set the initial background color
backgrounds: { value: 'light' },
},
});
import { definePreview } from '@storybook/vue3-vite';
export default definePreview({
parameters: {
backgrounds: {
options: {
// ๐ Default options
dark: { name: 'Dark', value: '#333' },
light: { name: 'Light', value: '#F7F9F2' },
// ๐ Add your own
maroon: { name: 'Maroon', value: '#400' },
},
},
},
initialGlobals: {
// ๐ Set the initial background color
backgrounds: { value: 'light' },
},
});
import { definePreview } from '@storybook/vue3-vite';
export default definePreview({
parameters: {
backgrounds: {
options: {
// ๐ Default options
dark: { name: 'Dark', value: '#333' },
light: { name: 'Light', value: '#F7F9F2' },
// ๐ Add your own
maroon: { name: 'Maroon', value: '#400' },
},
},
},
initialGlobals: {
// ๐ Set the initial background color
backgrounds: { value: 'light' },
},
});
import { definePreview } from '@storybook/angular';
export default definePreview({
parameters: {
backgrounds: {
options: {
// ๐ Default options
dark: { name: 'Dark', value: '#333' },
light: { name: 'Light', value: '#F7F9F2' },
// ๐ Add your own
maroon: { name: 'Maroon', value: '#400' },
},
},
},
initialGlobals: {
// ๐ Set the initial background color
backgrounds: { value: 'light' },
},
});
import { definePreview } from '@storybook/web-components-vite';
export default definePreview({
parameters: {
backgrounds: {
options: {
// ๐ Default options
dark: { name: 'Dark', value: '#333' },
light: { name: 'Light', value: '#F7F9F2' },
// ๐ Add your own
maroon: { name: 'Maroon', value: '#400' },
},
},
},
initialGlobals: {
// ๐ Set the initial background color
backgrounds: { value: 'light' },
},
});
import { definePreview } from '@storybook/web-components-vite';
export default definePreview({
parameters: {
backgrounds: {
options: {
// ๐ Default options
dark: { name: 'Dark', value: '#333' },
light: { name: 'Light', value: '#F7F9F2' },
// ๐ Add your own
maroon: { name: 'Maroon', value: '#400' },
},
},
},
initialGlobals: {
// ๐ Set the initial background color
backgrounds: { value: 'light' },
},
});