API
Skeleton
Props, slots and events of the component.
Props
| Prop | Purpose |
|---|---|
of | the result of useFetch, useAsyncData or useQuery: anything with data, status and error |
data, loading, empty, error | set by hand, instead of or on top of of |
sample | sample data that draws the shape |
id | key for the remembered shape; defaults to the page plus the order skeletons appear on it |
label | read to screen readers while loading |
persist | whether to remember the shape between visits; defaults to the module option |
reveal | fade, sequence or sweep; defaults to the module option |
Slots
| Slot | Props | Shown for |
|---|---|---|
| default | { data } | content and the skeleton |
skeleton | none | instead of the measured skeleton |
empty | none | an empty response |
error | { error } | an error |
Events
reveal fires when content has replaced the skeleton.
SkeletonBox
One placeholder box in the same style as the measured bones.
| Prop | Default |
|---|---|
width | 60% |
height | 1em |
radius | --skeleton-radius |
SkeletonSuspense
A Suspense boundary with a measured fallback. Takes the suspending component in the default slot, sample markup in #skeleton, and a label. It fires reveal when the component has resolved.