title |
---|
Story layout |
The layout
parameter allows you to configure how stories are positioned in Storybook's Canvas tab.
You can add the parameter to your ./storybook/preview.js
, like so:
<CodeSnippets paths={[ 'common/storybook-preview-layout-param.js.mdx' ]} />
In the example above, Storybook will center all stories in the UI. layout
accepts these options:
centered
: center the component horizontally and vertically in the Canvasfullscreen
: allow the component to expand to the full width and height of the Canvaspadded
: (default) Add extra padding around the component
You can also set it at a component level like so:
<CodeSnippets paths={[ 'common/storybook-component-layout-param.js.mdx', 'common/storybook-component-layout-param.mdx.mdx', ]} />
Or even apply it to specific stories like so:
<CodeSnippets paths={[ 'common/storybook-story-layout-param.js.mdx', 'common/storybook-story-layout-param.mdx.mdx', ]} />