mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
45 lines
1.1 KiB
Markdown
45 lines
1.1 KiB
Markdown
```js filename=".storybook/preview.js" renderer="common" language="js"
|
|
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' },
|
|
},
|
|
};
|
|
```
|
|
|
|
```ts filename=".storybook/preview.ts" renderer="common" language="ts"
|
|
// Replace your-renderer with the renderer you are using (e.g., react, vue3, angular, etc.)
|
|
import { Preview } from '@storybook/your-renderer';
|
|
|
|
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;
|
|
```
|