Home > Back-end >  How to add an image in Storybook within a component
How to add an image in Storybook within a component

Time:12-15

I am trying to add a logo image (svg) to my nav component. I am using Storybook and next.js.

I followed the config from enter image description here

CodePudding user response:

I've added it successfully, you need to do these:
1- add the static path as mentioned in the docs.
staticDirs: ['../public']
2- rerun the storybook command after changing main.js
2- add the image file like <img src="/images/img.png" /> to your component

enter image description here

  • Related