Skeleton
Loading placeholder drawn as a strip of character cells with a left-to-right scan sweep. Purely decorative (aria-hidden). Size it in cells with chars, or set dimensions via className.
Installation
dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.
The hosted registry is not public yet because r.b4r7.dev does not resolve. Use this source checkout or a local registry preview until the endpoint returns 200.
Diffgazer packages are not yet published to npm. Until the first release, pack @diffgazer/ui and @diffgazer/keys from the repository and install those tarballs.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.
Usage
Examples
Composed placeholder
API Reference
Skeleton
Data attributes
CSS variables
Accessibility
Notes
Dimensions
Skeleton has no intrinsic width. Pass chars to reserve the width of the value it stands in for (a 7-cell sha, a 40-cell path), or use Tailwind classes like w-32 h-4 for a proportional block. Height comes from className; the strip has a 12px floor so the cells stay legible.
Cell Grid
The strip is subdivided into --skeleton-cell wide cells by a mask, so it speaks the same character-cell alphabet as Spinner and BlockBar. The mask cuts the element's own background, which means a consumer background class still tiles into cells rather than filling the strip solid.
Reduced Motion
The scan sweep is dropped entirely under prefers-reduced-motion: reduce. The static cell grid still reads as pending.
Composition
Skeleton is one rectangle by design. Build a placeholder by composing several of them in the shape of the content being loaded — a square for an avatar, short bars for metadata, full-width bars for text — and keep the rhythm of the real layout so the swap to content does not jump.
Loading Announcements
Skeleton itself is decorative and aria-hidden. Put aria-busy on the region being loaded, or pair the loading state with a nearby status/live region when users need progress announced.
Source
Install via CLI: pnpm exec dgadd add ui/skeleton.
Highlighted source loads after this disclosure opens. Browse the source repository.