Skip to content

How to import image to the panel? #74

@egor-xyz

Description

@egor-xyz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions