#is it possible to show viewport styles on each stories on docs ?

3 messages · Page 1 of 1 (latest)

bitter spoke
#

Hi im new to storybook and im practicing it right now. im using vite react tailwind setup

is it possible to show viewport styles on each stories on docs ? or is it possible to control the iframe viewport on docs?

here's a link to my live storybook. You may get what i mean when you visit it. Thanks in advance.

https://newsletter-sign-up-with-success-message-storybook.vercel.app/?path=/docs/components-organism-sectionhomecard--docs&globals=backgrounds.grid:!false;backgrounds.value:!hsla(235,18,26,1)

fierce minnow
#

Hi! That's possible (mostly). I wrote up this gist a while ago to demonstrate: https://gist.github.com/kylegach/c529189196258a3c98cc8f2bfbd3c50b

(Make sure to view the "raw" MDX; I left helpful comments.)

Unfortunately, that's not longer correct for Storybook 7. I need to head out for the day, but I'll try to update it (and move it to an interactive sandbox) later.

Hopefully it's a helpful reference as-is, for now!

Gist

Storybook Canvas Doc Block that respects viewport parameters - Button.stories.mdx