Skeleton
Native Solid 2 fork. Original documentation and designs © WorkOS; historical posts retain their original context.
API Reference
This component is based on the span element and supports common margin props.
Examples
Size
Use the width and height props to manually control the size of the skeleton.
With children
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.
With text
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: