SkeletonLoaders

Replaces content while it's in a loading state.

Page navigation navigation

SkeletonText

SkeletonText shows a placeholder for loading text to improve perceived performance.

Avoid using it for interactive elements such as buttons. Instead, hide them until loading is complete and they're ready for interaction.

React
draftNot reviewed for a11y

React examples

Default

Multiple lines of text

Custom SkeletonText size

SkeletonText matches the font sizes and line heights in Primer. See typography docs and Primer Primitives for details.

titleLarge
titleMedium
titleSmall
bodyLarge
bodyMedium (default)
bodySmall
subtitle

With max width

Props

NameRequiredDescription
size
'display' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall' | 'subtitle'
Size of the text that the skeleton is replacing.
lines
number
Number of lines of skeleton text to render.
maxWidth
string
Maximum width that the line(s) of skeleton text can take up. Accepts any valid CSS `max-width` value.
className
string
Class name for custom styling.

SkeletonAvatar

SkeletonAvatars are placeholders for loading Avatars. They support the same variants as the Avatar component.

React
draftNot reviewed for a11y

React examples

Default

Custom size

Square variant

Props

NameRequiredDescription
size
number | { narrow?: number; regular?: number; wide?: number; }
The size of the avatar in pixels.
square
boolean
If true, the avatar will be square instead of circular.
className
string
Class name for custom styling.

SkeletonBox

A SkeletonBox provides a placeholder for non-text, non-Avatar elements (e.g., hero images) that are still loading. You can adjust width and height to match the content's dimensions.

React
draftNot reviewed for a11y

React examples

Custom width and height

Props

NameRequiredDescription
width
string
Width of the skeleton box. Accepts any valid CSS `width` value.
height
string
Height of the skeleton box. Accepts any valid CSS `height` value.
className
string
The className of the skeleton box
sx
SystemStyleObject