How to use SkeletonContainer
The SkeletonContainer
component is a wrapper component of the all other skeleton components: SkeletonBodyText
, SkeletonDisplayText
, SkeletonImage
, SkeletonRow
Use can use properties of SkeletonContainer
to control color, background color, animation, opacity of the skeleton elements that are used inside.
Import
import { SkeletonContainer } from '@contentful/f36-components';// orimport { SkeletonContainer } from '@contentful/f36-skeleton';
Code examples
An example with a different color and an increased speed.
Props
- Name
children(required)
ReactNode - Name
animateId
string - Name
ariaLabel
DescriptionLabel attribute
DefaultstringLoading component... - Name
backgroundColor
DescriptionBackground color of the skeleton
Defaultstring#e5ebed - Name
backgroundOpacity
DescriptionBackground opacity of the skeleton
Defaultnumber1 - Name
className
DescriptionCSS class to be appended to the root element
string - Name
clipId
string - Name
foregroundColor
DescriptionColor of the foreground skeleton items
Defaultstring#f7f9fa - Name
foregroundOpacity
DescriptionOpacity of the foreground skeleton items
Defaultnumber1 - Name
gradientId
string - Name
height
Defaultstringnumber100% - Name
isAnimated
DescriptionWhether skeleton has animation or not
Defaultfalsetruetrue - Name
preserveAspectRatio
string - Name
speed
DescriptionSpeed of the animation
Defaultstringnumber2 - Name
svgHeight
DescriptionHeight of the SVG element
Defaultstringnumber100% - Name
svgWidth
DescriptionWidth of the SVG element
Defaultstringnumber100% - Name
testId
DescriptionA [data-test-id] attribute used for testing purposes
Defaultstringcf-ui-skeleton-form - Name
width
Defaultstringnumber100%