Skip to content

Skeleton ​

Skeleton is a quiet placeholder while content loads. The shimmer is neutral gray, not a brand sweep.

Demos ​

Text rows

rows sets the line count. The last line is about 62% wide. With no shape props, text rows are the default.

Avatar and text

The avatar bone is a 40px circle with a 12px gap before the lines.

Button, image, animation off

Button bones match Button md (34×96). animated="false" is a flat gray block. Set --gk-skeleton-highlight only if an app wants a different sweep; the default highlight is white at 55% and is not brand tinted.
Left: shimmer. Right: static.

Loading false

loading="false" unmounts the bones and shows the default slot. prefers-reduced-motion: reduce turns the sweep off.
知
Knowledge card

The default slot is the real content.

Show content

Repeat

repeat duplicates the whole placeholder block. Each text group still shortens its last line.

Template slot

Put a custom layout in the template slot. It replaces the built-in bones while loading is true.

Loaded copy.

API ​

Skeleton Props ​

PropTypeDefault
loadingbooleantrue
animatedbooleantrue
repeatnumber1
textbooleanfalse (text rows are used when no other shape is set)
rowsnumber3
avatarbooleanfalse
buttonbooleanfalse
imagebooleanfalse
roundbooleanfalse
sharpbooleanfalse
width / heightstring | number—

Combine image, avatar, and text for a card placeholder. width and height size the image, button, or plain rectangle. height="100" is 100px.

Skeleton Slots ​

NameDescription
defaultReal content, shown when loading is false
templateCustom placeholder, shown instead of built-in bones while loading

CSS Parts ​

PartDescription
rootBlock wrapper
contentDefault slot container
avatar / text / line / button / imageShape bones
boneEvery placeholder block

CSS variables ​

VariableDefault
--gk-skeleton-basergba(46, 51, 56, 0.07)
--gk-skeleton-highlightrgba(255, 255, 255, 0.55)

Accessibility ​

  • While loading, the host sets aria-busy="true" and a visually hidden “Loading” / 「載入中」.
  • Bones are aria-hidden="true".
  • When loading finishes, busy is cleared and the bones are unmounted.