Replaces content with same shape placeholder that indicates a loading state.
This component is based on the span
element and supports common margin props.
Use the width and height props to manually control the size of the skeleton.
Use the loading
prop to control whether the skeleton or its children are displayed. Skeleton preserves the dimensions of children when they are hidden and disables interactive elements.
When using Skeleton with text, you’d usually wrap the text node itself rather than the parent element. This ensures that the text is replaced with a placeholder of the same size:
The difference is especially noticeable when wrapping longer paragraphs: