Skip to main content

Skeleton

Placeholder shapes while content loads.

Daily order totals per region…

<mm-skeleton loading shape="text" count="3">
<p>Daily order totals per region…</p>
</mm-skeleton>

Guidance​

Skeletons hold the shape of content that is on its way: text lines, a block, an avatar circle or table rows, in a fill mixed from mm-rule and paper. Wrap the real content and toggle loading: the placeholder appears only after 200ms, so fast loads never flash, and once shown it stays at least 400ms before the slotted content swaps in. The container is aria-busy while loading.

The only motion is a very slow opacity breath, never a gradient sweep, and none under reduced motion.

Properties​

PropertyAttributeTypeDefaultDescription
loadingloadingbooleanfalseWhether the content is loading.
shapeshapeSkeletonShape'text'text (default), rect, circle or table-row.
countcountnumber3Lines for text, rows for table-row.
columnscolumnsnumber4Columns for table-row. The last column is right-aligned like a number column.

Slots​

SlotDescription
DefaultThe real content, shown once loading finishes.

CSS parts​

PartDescription
baseThe busy container.
placeholderThe placeholder shapes.

CSS custom properties​

PropertyDescription
--mm-skeleton-widthWidth of rect and circle. Defaults to 100% and 32px.
--mm-skeleton-heightHeight of rect and circle. Defaults to 96px and 32px.

Examples​

Every state of mm-skeleton in Storybook, with keyboard and screen reader tests.