gokcan/react-shimmer

How to apply custom css classes to <img>?

Closed this issue · 2 comments

I want to add custom css into <img, there's no props to handle that

Edit--
I'm already tried add css into className props didn't work

<Image
   src={item.image}
  width={512}
  height={512}
  alt="Berita1"
  className="rounded-xl"
   fadeIn={true}
   delay={2}
  fallback={<Shimmer width={512} height={512} />}
/>

Screen Shot 2023-04-05 at 14 37 27

gokcan commented

You may use NativeImgProps. Also, alt should be used with NativeImgProps.

Reference: https://github.com/gokcan/react-shimmer#properties

Example:

<Image
  src={item.image}
  width={512}
  height={512}
  fadeIn={true}
  delay={2}
  fallback={<Shimmer width={512} height={512} />}
  NativeImgProps={{ alt="Berita1", className: "rounded-xl" }}
/>
gokcan commented

Also, see: #71