Skip to content
v0.2.10

Skeleton

A decorative placeholder that reserves space for loading content.

Preview

Use Skeleton

Skeleton is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
skeleton.tsxTSX
"use client";

import { FloodRoot, Stack, Skeleton } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Stack gap="2">
        <Skeleton width="65%" />
        <Skeleton />
        <Skeleton width="80%" />
      </Stack>
    </FloodRoot>
  );
}

Design notes

  • Always hidden from assistive technology. The host owns loading announcements and aria-busy on the relevant region.
  • Width and height accept CSS dimensions; style overrides them. Match the final content geometry.
  • Animation can be disabled; reduced motion and forced colors disable the pulse. Available in 0.2.4.

API reference

PropValuesDefault
shape"text" | "rounded" | "circle""text"
widthCSSProperties["width"]—
heightCSSProperties["height"]—
animatebooleantrue
Native HTML propsOmit<HTMLAttributes<HTMLSpanElement>, "children" | "role" | "tabIndex" | "aria-label" | "aria-hidden">Forwarded
View TypeScript source