Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import image to the panel? #74

Open
egor-xyz opened this issue Feb 4, 2025 · 0 comments
Open

How to import image to the panel? #74

egor-xyz opened this issue Feb 4, 2025 · 0 comments

Comments

@egor-xyz
Copy link

egor-xyz commented Feb 4, 2025

How to import and use images? For example in src/Panel.tsx file:

import logo from "../assets/logo.png";

...
<Fragment>
  <img src={logo} />

  Addons1 can gather details about how a story is rendered. This is
  panel uses a tab pattern. Click the button below to fetch data for
  the other two tabs.
</Fragment>
...

Vite moved image in dist folder:

dist/logo-TFTQLNMJ.png

but path to this image ./logo-TFTQLNMJ.png
Correct URL to image in storybook dev mode must be: /dist/logo-TFTQLNMJ.png

And it doesn't work when I'm using the addon in another storybook.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant