Install
Pull Skeleton from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { Skeleton } from "@brika/clay";import { Skeleton } from "@brika/clay/components/skeleton";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
import { Skeleton } from '@brika/clay/components/skeleton';
/** Single line skeleton, match width to expected text content. */
export default function SkeletonDefaultDemo() {
return <Skeleton className="h-4 w-48" />;
}Skeleton, every way
Accessibility
- Mark skeleton containers with
aria-hidden="true"andaria-busy="true"on the parent. - When content loads, remove the busy state and announce the result via a live region.
- Do not use
Skeletoninside elements that carry interactive roles.
Theme tokens
Every CSS variable Skeleton reads, with its default and the
dotted path you'd write in a ThemeConfig JSON
to override it. Set any of these in your theme to retune Skeleton
without touching component code.
Skeleton tokens
1 token--skeleton-pulse-colorcolorvar(--accent)components.skeleton.pulseColorBackground color of the skeleton placeholder block. The Tailwind `animate-pulse` keyframes fade this fill in and out to read as loading.
Override in a theme
Authoring a theme is plain JSON. Drop overrides under
components.skeleton, the names
are camelCase versions of the variable suffix.
{
"id": "my-theme",
"name": "My Theme",
"description": "...",
"accentSwatches": ["#000"],
"components": {
"skeleton": {
"pulseColor": "var(--accent)"
}
}
}
Then apply with applyTheme(myTheme)
(see the theming guide),
scope it to a subtree with themeToCssVars(myTheme, mode),
or consume any token directly in your own JSX with the matching Tailwind utility
(e.g. bg-skeleton-…) — see the
chips on each token row.
API reference
Props specific to Skeleton. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.
No wrapper-specific props, all attributes pass through to the underlying primitive.