How to use SkeletonDisplayText
Use the SkeletonDisplayText
component to simulate headings, subheadings or titles whenever loading asynchronous data.
Import
import { SkeletonDisplayText } from '@contentful/f36-components';// orimport { SkeletonDisplayText } from '@contentful/f36-skeleton';
Code examples
Best practices
- Each
SkeletonDisplayText
needs to be wrapped by aSkeletonContainer
component - Only use it to mimic headings and titles, for normal text we recommend using SkeletonBodyText.
Props
- Name
lineHeight
DescriptionA height of a one line (in pixels)
Defaultstringnumber21 - Name
marginBottom
DescriptionSpacing between lines (in pixels)
Defaultstringnumber20 - Name
numberOfLines
DescriptionA number of skeleton likes
Defaultnumber1 - Name
offsetLeft
DescriptionA distance between left of the container and the beginning of lines (in pixels)
Defaultstringnumber0 - Name
offsetTop
DescriptionA distance between top of the container and the first line (in pixels)
Defaultstringnumber0 - Name
width
DescriptionA width of a line
Defaultstringnumber100