# Skeleton

Loading placeholders with a shared shimmer and content reveal.

Access: free. Category: Feedback. Kind: primitive.

## When to use

- Use it when a product interface needs loading placeholders with a shared shimmer and content reveal.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.

## Alternatives

- Choose alert instead when inline notices with icons, actions and optional dismissal is the actual interface need, rather than skeleton.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Skeleton

```sh
npx shadcn@latest add https://tidalui.com/r/skeleton.json
```

Stylesheets: `components/ui/tidal.css`, `components/ui/skeleton.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/skeleton.css";
import{TidalSkeleton}from"./components/ui/skeleton";
export default()=><div className="tidal-scope"><TidalSkeleton/></div>;
```

## Structured props

- `TidalSkeleton.animated?: boolean | undefined` (default true): Optional animated value accepted by this exported component.
- `TidalSkeleton.height?: Property.Height<string | number> | undefined`: Optional height value accepted by this exported component.
- `TidalSkeleton.shape?: "circle" | "line" | "rounded" | undefined` (default "line"): Optional shape value accepted by this exported component.
- `TidalSkeleton.width?: Property.Width<string | number> | undefined`: Optional width value accepted by this exported component.
- `TidalSkeletonRegion.children: ReactNode`: Required children value accepted by this exported component.
- `TidalSkeletonRegion.label: string`: Required label value accepted by this exported component.
- `TidalSkeletonRegion.loading: boolean`: Required loading value accepted by this exported component.
- `TidalSkeletonRegion.placeholder: ReactNode`: Required placeholder value accepted by this exported component.
- `TidalSkeletonRegion.animateHeight?: boolean | undefined` (default true): Disable for content that must overflow its box or has an externally fixed height.
- `TidalSkeletonRegion.announce?: boolean | undefined` (default false): Optional announce value accepted by this exported component.
- `TidalSkeletonRegion.loadingLabel?: string | undefined` (default "Loading content"): Optional loading label value accepted by this exported component.
- `TidalSkeletonRegion.readyLabel?: string | undefined` (default "Content ready"): Optional ready label value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/skeleton.tsx) | [Manifest](https://tidalui.com/examples/skeleton.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
import "./components/ui/tidal.css";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties } from "react";

import { Check, LayoutDashboard, RotateCcw, ArrowUpRight } from "lucide-react";

import { TidalSkeleton, TidalSkeletonRegion } from "./components/ui/skeleton";

import { TidalButton } from "./components/ui/tidal-button";

import { TidalStatusBadge } from "./components/ui/status-badge";

import "./components/ui/skeleton.css";

import "./components/ui/status-badge.css";



const tidalExampleStyles = ".skeleton-specimen {\n  width: 100%;\n  max-width: 620px;\n  padding: 28px;\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-card);\n  background: var(--t-surface);\n  box-shadow:\n    0 24px 40px -28px #00000035,\n    0 2px 4px #00000008;\n}\n.skeleton-specimen > h3 {\n  font-size: 29px;\n  line-height: 1.08;\n  letter-spacing: -1px;\n  font-weight: 500;\n  margin: 13px 0 25px;\n}\n.skeleton-specimen > h3 > em {\n  font-family: \"Instrument Serif\", serif;\n  font-size: 1.2em;\n  font-weight: 400;\n}\n.skeleton-demo-shell {\n  border: 1px solid var(--t-ink);\n  border-radius: 14px;\n  padding: 12px;\n  background: var(--t-ink);\n  color: var(--t-surface);\n  box-shadow: 0 12px 22px -14px #00000045;\n}\n.skeleton-demo-shell-top {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 2px 2px 13px;\n  font-size: 11px;\n  letter-spacing: 1.1px;\n}\n.skeleton-demo-shell-top > span:first-child {\n  display: flex;\n  align-items: center;\n  gap: 6px;\n}\n.skeleton-demo-shell-top > span:first-child > span {\n  width: 5px;\n  height: 5px;\n  border-radius: 50%;\n  border: 1px solid currentColor;\n}\n.skeleton-demo-shell-top > span:last-child {\n  opacity: 0.7;\n}\n.skeleton-demo-paper {\n  padding: 22px;\n  border-radius: 8px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n}\n.skeleton-demo-summary {\n  display: flex;\n  align-items: center;\n  gap: 11px;\n  min-height: 46px;\n}\n.skeleton-demo-summary > div:not(.tidal-skeleton) {\n  flex: 1;\n  min-width: 0;\n}\n.skeleton-demo-summary > .tidal-skeleton {\n  flex: none;\n}\n.skeleton-demo-summary strong {\n  display: block;\n  font-size: 12px;\n  font-weight: 550;\n}\n.skeleton-demo-summary small {\n  display: block;\n  color: var(--t-muted);\n  font-size: 11px;\n  margin-top: 5px;\n}\n.skeleton-demo-summary > .tidal-status-badge {\n  flex: none;\n}\n.skeleton-demo-icon {\n  width: 46px;\n  height: 46px;\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n  display: grid;\n  place-items: center;\n  background: linear-gradient(160deg, var(--t-surface), var(--t-wash));\n  box-shadow:\n    inset 0 1px 0 #ffffff13,\n    0 1px 2px #00000008;\n  flex: none;\n}\n.skeleton-demo-metric {\n  display: flex;\n  align-items: center;\n  gap: 16px;\n  margin: 24px 0 20px;\n  min-height: 46px;\n}\n.skeleton-demo-metric > span:last-child > strong {\n  display: block;\n  font-size: 11px;\n  font-weight: 500;\n}\n.skeleton-demo-metric > span:last-child > small {\n  display: flex;\n  align-items: center;\n  gap: 3px;\n  font-size: 11px;\n  color: var(--t-muted);\n  margin-top: 6px;\n}\n.skeleton-demo-value {\n  font-size: 44px;\n  line-height: 46px;\n  letter-spacing: -2px;\n  font-variant-numeric: tabular-nums;\n  font-weight: 500;\n}\n.skeleton-demo-value > span {\n  display: flex;\n}\n.skeleton-demo-digit {\n  display: block;\n  overflow: hidden;\n  height: 46px;\n  width: 0.64em;\n}\n.skeleton-demo-digit > span {\n  display: block;\n  transform: translateY(var(--digit-position));\n  animation: skeleton-demo-roll 660ms var(--t-ease-out) both;\n}\n.skeleton-demo-digit > span > span {\n  display: block;\n  height: 46px;\n}\n@keyframes skeleton-demo-roll {\n  from {\n    transform: translateY(-90%);\n  }\n  to {\n    transform: translateY(var(--digit-position));\n  }\n}\n.skeleton-demo-figure {\n  margin: 0;\n}\n.skeleton-demo-chart {\n  display: flex;\n  align-items: stretch;\n  gap: 12px;\n  height: 108px;\n  padding-top: 8px;\n}\n.skeleton-demo-chart > div {\n  flex: 1;\n  min-width: 0;\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  align-items: center;\n  gap: 9px;\n}\n.skeleton-demo-bar {\n  width: 100%;\n  border-radius: 4px 4px 1px 1px;\n  background: linear-gradient(\n    180deg,\n    color-mix(in srgb, var(--t-ink) 73%, var(--t-surface)),\n    var(--t-ink)\n  );\n  transform-origin: bottom;\n  animation: skeleton-demo-bar-in 520ms var(--t-ease-out) both;\n}\n.skeleton-demo-chart > div > span:last-child {\n  font-size: 11px;\n  color: var(--t-muted);\n  line-height: 12px;\n}\n.skeleton-demo-figure figcaption {\n  font-size: 11px;\n  color: var(--t-muted);\n  margin-top: 12px;\n  padding-bottom: 15px;\n  border-bottom: 1px solid var(--t-border);\n}\n@keyframes skeleton-demo-bar-in {\n  from {\n    transform: scaleY(0.08);\n    opacity: 0;\n  }\n  to {\n    transform: scaleY(1);\n    opacity: 1;\n  }\n}\n.skeleton-demo-events {\n  margin-top: 8px;\n}\n.skeleton-demo-events > div {\n  display: flex;\n  align-items: center;\n  gap: 9px;\n  min-height: 37px;\n  font-size: 11px;\n}\n.skeleton-demo-ready .skeleton-demo-events > div {\n  animation: skeleton-demo-row-in 360ms var(--t-ease-out) both;\n}\n.skeleton-demo-events > div > span:nth-child(2) {\n  flex: 1;\n  min-width: 0;\n}\n.skeleton-demo-events small {\n  color: var(--t-muted);\n  font-size: 11px;\n  letter-spacing: 0.5px;\n}\n.skeleton-demo-check {\n  width: 23px;\n  height: 23px;\n  border-radius: 50%;\n  display: grid;\n  place-items: center;\n  background: var(--t-wash);\n  color: var(--t-ink);\n  flex: none;\n}\n@keyframes skeleton-demo-row-in {\n  from {\n    opacity: 0;\n    transform: translateX(-5px);\n  }\n  to {\n    opacity: 1;\n    transform: translateX(0);\n  }\n}\n.skeleton-demo-placeholder\n  .skeleton-demo-summary\n  > div\n  > .tidal-skeleton\n  + div {\n  margin-top: 10px;\n}\n.skeleton-demo-placeholder .skeleton-demo-metric {\n  align-items: flex-end;\n  gap: 16px;\n}\n.skeleton-demo-placeholder .skeleton-demo-metric > .tidal-skeleton:last-child {\n  margin-bottom: 9px;\n}\n.skeleton-demo-placeholder .skeleton-demo-chart > .tidal-skeleton {\n  flex: none;\n}\n.skeleton-demo-placeholder .skeleton-demo-events {\n  border-top: 1px solid var(--t-border);\n  padding-top: 15px;\n  margin-top: 39px;\n}\n.skeleton-demo-placeholder\n  .skeleton-demo-events\n  > div\n  > .tidal-skeleton:nth-child(2) {\n  margin-right: auto;\n}\n.skeleton-demo-placeholder\n  .skeleton-demo-chart\n  > div\n  > .tidal-skeleton:first-child {\n  width: 100%;\n  border-radius: 4px 4px 1px 1px;\n}\n.skeleton-demo-actions {\n  display: flex;\n  gap: 8px;\n  flex-wrap: wrap;\n  margin-top: 22px;\n}\n.skeleton-demo-actions > .tidal-button {\n  font-size: 11px;\n  padding-inline: 13px;\n}\n.skeleton-demo-note {\n  margin: 16px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.7;\n  min-height: 16px;\n}\n@media (max-width: 480px) {\n  .skeleton-specimen {\n    padding: 22px;\n  }\n  .skeleton-demo-paper {\n    padding: 17px;\n  }\n  .skeleton-demo-summary {\n    gap: 8px;\n    flex-wrap: wrap;\n  }\n  .skeleton-demo-summary > div:not(.tidal-skeleton) {\n    min-width: 120px;\n  }\n  .skeleton-demo-summary > .tidal-status-badge,\n  .skeleton-demo-summary > .tidal-skeleton:last-child {\n    margin-left: 54px;\n  }\n  .skeleton-demo-chart {\n    gap: 9px;\n  }\n  .skeleton-demo-metric {\n    gap: 12px;\n  }\n  .skeleton-demo-metric > span:last-child > small {\n    font-size: 11px;\n  }\n}\n@media (prefers-reduced-motion: reduce) {\n  .skeleton-demo-bar {\n    transform: none;\n  }\n  .skeleton-demo-ready .skeleton-demo-events > div {\n    transform: none;\n  }\n}";

const days = [
  { day: "Mon", tasks: 9 },
  { day: "Tue", tasks: 12 },
  { day: "Wed", tasks: 7 },
  { day: "Thu", tasks: 11 },
  { day: "Fri", tasks: 15 },
  { day: "Sat", tasks: 13 },
  { day: "Sun", tasks: 17 },
];

function SampleSkeleton() {
  return (
    <div className="skeleton-demo-placeholder">
      <div className="skeleton-demo-summary">
        <TidalSkeleton width={46} height={46} shape="rounded" />
        <div>
          <TidalSkeleton width="68%" height={12} />
          <TidalSkeleton width="44%" height={9} />
        </div>
        <TidalSkeleton width={92} height={23} />
      </div>
      <div className="skeleton-demo-metric">
        <TidalSkeleton width={86} height={46} />
        <TidalSkeleton width={112} height={9} />
      </div>
      <div className="skeleton-demo-chart" aria-hidden="true">
        {days.map((d, i) => (
          <div key={d.day}>
            <TidalSkeleton height={`${36 + i * 8}%`} shape="rounded" />
            <TidalSkeleton width="60%" height={7} />
          </div>
        ))}
      </div>
      <div className="skeleton-demo-events">
        {[0, 1, 2].map((i) => (
          <div key={i}>
            <TidalSkeleton shape="circle" width={23} height={23} />
            <TidalSkeleton width={`${64 - i * 11}%`} height={10} />
            <TidalSkeleton width={28} height={8} />
          </div>
        ))}
      </div>
    </div>
  );
}

function SampleOverview() {
  return (
    <div className="skeleton-demo-ready">
      <div className="skeleton-demo-summary">
        <span className="skeleton-demo-icon">
          <LayoutDashboard size={19} aria-hidden="true" />
        </span>
        <div>
          <strong>Northstar overview</strong>
          <small>Fictional workspace · this week</small>
        </div>
        <TidalStatusBadge label="Sample data" status="success" size="sm" />
      </div>
      <div className="skeleton-demo-metric">
        <span className="skeleton-demo-value" aria-label="84 completed tasks">
          <span aria-hidden="true">
            {[8, 4].map((digit, i) => (
              <span className="skeleton-demo-digit" key={i}>
                <span
                  style={
                    {
                      "--digit-position": `-${digit * 10}%`,
                      animationDelay: `${i * 60}ms`,
                    } as CSSProperties
                  }
                >
                  {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((n) => (
                    <span key={n}>{n}</span>
                  ))}
                </span>
              </span>
            ))}
          </span>
        </span>
        <span>
          <strong>Completed tasks</strong>
          <small>
            <ArrowUpRight size={11} aria-hidden="true" /> +16.7% from last
            week's 72
          </small>
        </span>
      </div>
      <figure
        className="skeleton-demo-figure"
        aria-label="Completed sample tasks, Monday to Sunday: 9, 12, 7, 11, 15, 13, 17. Total 84."
      >
        <div className="skeleton-demo-chart" aria-hidden="true">
          {days.map((d, i) => (
            <div key={d.day}>
              <span
                className="skeleton-demo-bar"
                style={{
                  height: `${(d.tasks / 17) * 82}px`,
                  animationDelay: `${110 + i * 45}ms`,
                }}
              />
              <span>{d.day}</span>
            </div>
          ))}
        </div>
        <figcaption>Seven days of steady progress.</figcaption>
      </figure>
      <div className="skeleton-demo-events">
        {[
          "Landing page refreshed",
          "Design tokens reviewed",
          "Preview prepared",
        ].map((event, i) => (
          <div key={event} style={{ animationDelay: `${250 + i * 65}ms` }}>
            <span className="skeleton-demo-check">
              <Check size={11} aria-hidden="true" />
            </span>
            <span>{event}</span>
            <small>0{i + 1}</small>
          </div>
        ))}
      </div>
    </div>
  );
}

export function SkeletonDemo() {
  const [loading, setLoading] = useState(false);
  const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
  const replayButton = useRef<HTMLButtonElement | null>(null),
    focusOwner = useRef<HTMLElement | null>(null);
  useEffect(() => () => clearTimeout(timer.current), []);
  useLayoutEffect(() => {
    if (loading || !focusOwner.current) return;
    const active = document.activeElement;
    if (active === document.body || active === focusOwner.current)
      replayButton.current?.focus({ preventScroll: true });
    focusOwner.current = null;
  }, [loading]);
  function replay(source: HTMLElement) {
    clearTimeout(timer.current);
    focusOwner.current = source;
    setLoading(true);
    timer.current = setTimeout(() => setLoading(false), 1600);
  }
  function reset() {
    clearTimeout(timer.current);
    focusOwner.current = null;
    setLoading(false);
  }
  return (
    <div className="skeleton-specimen" data-loading={loading}>
      <div className="skeleton-demo-shell">
        <div className="skeleton-demo-shell-top">
          <span>
            <span aria-hidden="true" /> OVERVIEW
          </span>
          <span>{loading ? "LOADING" : "RESOLVED"}</span>
        </div>
        <div className="skeleton-demo-paper">
          <TidalSkeletonRegion
            label="Sample workspace overview"
            loading={loading}
            placeholder={<SampleSkeleton />}
            loadingLabel="Loading sample overview"
            readyLabel="Sample overview ready"
            announce
          >
            <SampleOverview />
          </TidalSkeletonRegion>
        </div>
      </div>
      <div className="skeleton-demo-actions">
        <TidalButton
          ref={replayButton}
          onClick={(event) => replay(event.currentTarget)}
          disabled={loading}
        >
          <RotateCcw size={13} aria-hidden="true" />
          Replay loading
        </TidalButton>
        <TidalButton variant="ghost" onClick={reset} disabled={!loading}>
          Show content
        </TidalButton>
      </div>
      <p className="skeleton-demo-note">
        {loading
          ? "Matching shapes hold the space while the sample loads."
          : "A simulated delay, followed by real selectable sample content."}
      </p>
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <SkeletonDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

TidalSkeleton: optional width/height (CSS lengths or numbers), shape line|rounded|circle, animated(defaulttrue), native div attributes/ref/style/className. Decorative and aria-hidden; style overrides width/height. TidalSkeletonRegion: required label, controlled loading, placeholder:ReactNode and children. Optional loadingLabel/readyLabel, announce(defaultfalse), animateHeight(defaulttrue), native div attributes/ref/className/style. Placeholder is inert and aria-hidden; only loaded children enter the accessible tree. Children unmount on reload; lift persistent state above the region. A ResizeObserver interpolates natural height, using layout measurements that ignore ancestor transforms. Disable animateHeight for externally fixed or overflowing content. Keep placeholders shaped like the expected content; caller owns fetching, errors and actual data. Sweeps run only while loading and stop under reduced motion, which shows final geometry immediately.
