0

I need to create Skeleton using the react-loading-skeleton library. One item should have border radius like at the picture below.

enter image description here

Do you know how to make it?

My lib version: "react-loading-skeleton": "1.2.0" (low possibility of upgrade)

I tried to solve it in this way, but it doesn't work :(

<Skeleton
    width={127}
    borderRadius={12.5}
/>
It'sNotMe
  • 1,184
  • 1
  • 9
  • 29
karo-s
  • 384
  • 2
  • 15
  • Add a wrapper to your Skeleton like in the documentation : https://github.com/dvtng/react-loading-skeleton#custom-wrapper Use css border-radius and maybe overflow hidden if necessary. – Sephyre Nov 16 '21 at 12:02
  • I tried, it didn't work – karo-s Nov 16 '21 at 12:20

1 Answers1

0

Use a wrapper like this :

.rounded-skeleton {
  border-radius: 200px;
  overflow: hidden;
}

JSX:

  <div className="rounded-skeleton">
    <Skeleton />
  </div>

CodeSandbox here

Sephyre
  • 326
  • 2
  • 13