Skip to content
Page

Skeleton

Placeholder shape while content loads.

import { Skeleton } from "@pelagornis/page/components";

The preview above renders this file. Copy it into src/components/ to start from it.

src/components/SkeletonExample.tsx
import { Skeleton, Stack } from "@pelagornis/page/components";
export default function SkeletonDemo() {
return (
<Stack direction="row" gap="sizeMedium" align="center" className="w-full max-w-sm">
<Skeleton width={48} height={48} shape="circle" />
<Stack gap="sizeXSmall" className="flex-1">
<Skeleton width="60%" height={16} />
<Skeleton width="100%" height={12} />
</Stack>
</Stack>
);
}

Skeleton can be written straight in an .mdx page. Import it below the frontmatter. It renders on the server, so no client directive is needed.

src/content/docs/example.mdx
---
title: Example
---
import { Skeleton } from "@pelagornis/page/components";
<Skeleton width="60%" height={16} />

pageMarkdoc() registers a skeleton tag for this component. Add the preset once in markdoc.config.mjs (see Use in Markdoc), then write the tag in any .mdoc page.

src/content/docs/example.mdoc
{% skeleton width="60%" height=16 /%}

Attributes use the same names and values as the React props.

Parts of the component and the data-refineui role each one renders.

PartRole
rootskeleton