How to make a border-radius for Skeleton by react-loading-skeleton?

729 Views Asked by At

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}
/>
1

There are 1 best solutions below

0
Sephyre On

Use a wrapper like this :

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

JSX:

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

CodeSandbox here