Skeleton
Skeleton is a static / animated placeholder for the information that is still loading. It mimics the structure and look of the entire view
The Basics
What it is
The Skeleton component is a visual placeholder for content that isn't yet known, but will appear once communication with a server is complete. It should reflect the general structure of what the actual content will be, but in abstract form (think a designer's sketch).
Thanks to the following people for this community contribution! This component is now maintained by Forge
- Designers: Laura Materna & Len Ning
- Developer: Mike Wessler
How it works
- The user takes some action that will cause data to load from a server
- A set of skeleton components appears mimicking in low-fidelity what the eventual UI structure will look like when the content arrives
- The skeleton component shimmers to indicate that something is happening
- When the data arrives, the skeleton components are replaced with the actual data content
When to use
- To indicate that something is loading, where the thing that is loading has a known structure, even if the exact content isn't known yet
- To give the user a sense of what is about to appear
When not to use
- For data whose display doesn’t have a specific structure, or may have multiple different structures
- For large solid areas like a single large image
- For entire applications or pages
- For indicating that a load failed
- When the content you are loading is miniscule, like a number that has yet to be calculated. For something that small, opt for a text treatment such as “calculating x…”
- Do not combine a Skeleton and a Loader in the same space (Use one or the other)
What to use instead
Loader
Use Loader instead when there is no placeholder structure, or there could be more than one type of structure that appears.
How to use
- Use an appropriate Skeleton type to replace each piece of unknown content: type=“text” for lines of text, type=“box” or “circle” for smaller images as appropriate
- Use the same container structure and layout that you would have used to render the final content
- Select a width and minWidth for text components that mimic the expected range of lengths of data
- Don’t attempt to mimic wrapped text if wrapping is accidental and occasional
- If you don’t know the number of items that will load, use two
- If you do know the total number of items, but don’t know their content, use a skeleton for each item
- Do include any layout-specific decorations (like horizontal rules, borders, margins, etc) that are consistent no matter what the data is
- Skeletons are NEVER interactive
Style
Design details
- Available placeholder elements:
- “text” for lines of text (will show up as gray bars)
- “box” or