storyblok-toolkit icon indicating copy to clipboard operation
storyblok-toolkit copied to clipboard

[Image] Provide a hook that returns props to pass onto a next/image component

Open empz opened this issue 3 years ago • 1 comments

I know this library is not specific to Next.js but since it does have some Next.js-specific features I think it would be nice to have a component and/or hook to use the native next/image component.

Even though the already included Image component in this library works great and it's not Next-specific, there are some features missing from the next/image component (I couldn't get the Image component to behave like the next/image with layout=fill)

What about adding a useNextStoryblokImage that returns the props to pass to a next/image component? Something similar to what they've done in next-sanity-image.

empz avatar Oct 06 '21 08:10 empz

Sounds like a useful feature, I'll look into it!

For layout=fill, maybe you can target .storyblok-image-wrapper with some css, and try to play around with the fit prop to get something similar.

BJvdA avatar Oct 07 '21 20:10 BJvdA