API REFERENCE · FEEDBACK
<dj-skeleton>
A loading placeholder that stands in for content while it loads.
npm install @dojo-ng/skeleton
import "@dojo-ng/skeleton";
Size and shape
- Style the host with CSS; there are no shape properties. It is
display: block,1emhigh by default, with the theme's border radius. - For a line of text, give it a short height and a width. For an avatar, make it square and add
border-radius: 50%. effect="sheen"(the default) shows a moving sheen;effect="none"shows a still surface.
Accessibility
- The skeleton is always
aria-hidden="true", because it is decoration. - Mark the region that is loading with
aria-busy="true"until the real content arrives. Screen readers then announce the loading state once for the region, not once per placeholder. - Under
prefers-reduced-motion, the sheen does not move, whatevereffectsays.
Properties
| Property | Attribute | Type | Default |
|---|---|---|---|
effectLoading animation: a sweeping sheen, or none for a static placeholder. |
effect reflected |
"sheen""none" |
"sheen" |
CSS parts
Style these with dj-skeleton::part(name).
| Part | Description |
|---|---|
base | the placeholder surface |