codesandbox/sandpack

support images

Closed this issue · 1 comments

Tell us how you think we can improve Sandpack

Packages affected

  • sandpack-client
  • sandpack-react

What is this feature?

Ability to add images that can be imported. I do understand that adding image support is not on the radar. #101. But a simple thing that can be allowed might be to just push things to a internal public folder and then just load them from their as is.

I think it is important to support images as lot of libraries will want to show images, for example all component libraries have avatar or other components that use images a lot.

Current workaround is to convert every image to datauri which is ok I think but the public folder approach might be better.

How would your idea work?

answered above

Do you have any examples of how you would like to see us implement it?

answered above

When I get some time will try to also figure out how it might be possible and make a POC.

It should be possible now, check the documentation: https://sandpack.codesandbox.io/docs/advanced-usage/serving-static-files.

Please, let me know if it worked for you and make sure to leave feedback :)