How to use SkeletonImage
Use the SkeletonImage component to simulate images, illustrations, avatars or icons whenever loading asynchronous data.
Import
import { SkeletonImage } from '@contentful/f36-components';// orimport { SkeletonImage } from '@contentful/f36-skeleton';
Code examples
Best practices
- Each
SkeletonImageneeds to be wrapped by aSkeletonContainercomponent. - Pass some value to the
widthandheightprops to make the skeleton the same size as the simulated image (default values are 70). You can use the same values a normal<rect>tag would accept for width and height
- Pass some value to the
radiusXandradiusYprops to control the roundness of skeleton's corners (default values are 0). You can use the same values a normal<rect>tag would accept for rx and ry
Props
- Name
height
Defaultstringnumber70 - Name
offsetLeft
stringnumber - Name
offsetTop
stringnumber - Name
radiusX
Defaultstringnumber0 - Name
radiusY
Defaultstringnumber0 - Name
testId
Defaultstringcf-ui-skeleton-image - Name
width
Defaultstringnumber70