Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Skeleton

Use Skeleton to display shimmering content placeholders while data loads. Skeleton is a container that lays out one or more SkeletonRow children, each of which renders a placeholder line, heading, or your own inline SVG shape. Both Skeleton and SkeletonRow are exported from the same package.

The SDK Skeleton showing shimmering content placeholders while data loads.
import { Skeleton, SkeletonRow } from '@dropins/tools/components.js';

Skeleton sets the gap between its rows and renders SkeletonRow children.

PropTypeReq?Description
rowGap'xsmall' | 'small' | 'medium' | 'big' | 'xbig'NoHorizontal and vertical gap between rows. Defaults to medium.

Skeleton also accepts standard HTML attributes (for example, className, style), except size.

Each SkeletonRow renders one placeholder. Pass an SVG string as its child to render a shimmering version of that shape instead.

PropTypeReq?Description
variant'heading' | 'row' | 'empty'NoType of placeholder to render. Defaults to row.
size'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'NoSize of the placeholder. Defaults to small.
linesnumberNoNumber of times to repeat the row. Defaults to 1.
fullWidthbooleanNoStretch the placeholder to full width. Defaults to false.
multilineGap'xsmall' | 'small' | 'medium' | 'big' | 'xbig'NoVertical gap between multiline items. Defaults to medium.
childrenstringNoAn SVG string rendered as a shimmering shape.

Build the rows with h and pass them as children.

import { Skeleton, SkeletonRow, provider } from '@dropins/tools/components.js';
import { h } from '@dropins/tools/preact.js';
await provider.render(Skeleton, {
rowGap: 'medium',
children: [
h(SkeletonRow, { variant: 'heading', size: 'medium' }),
h(SkeletonRow, { size: 'medium', fullWidth: true, lines: 3 }),
],
})(document.querySelector('.skeleton'));