# Skeleton

A decorative shimmer placeholder that preserves the expected text, avatar, or block layout while content loads.

Version: 0.2.0-preview.1 (preview)
Content digest: 70ac710f4d22dce040e7ac593379ba8aca9dcb59a0b9c0f839819cae0e2bb721
Contract kind: source-derived
Source: packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx

## Guidance

{
  "summary": "A decorative shimmer placeholder that preserves the expected text, avatar, or block layout while content loads.",
  "guidance": [
    {
      "heading": "Overview",
      "body": "A shimmer placeholder that stands in for content while it loads, sized to the shape it replaces."
    },
    {
      "heading": "When to use",
      "body": "Reach for `Skeleton` to hold the layout in place while data loads, so the screen doesn't jump when\ncontent arrives. It is decorative — `aria-hidden` and reduced-motion aware — so it never announces a\nbusy state to assistive tech. Size each placeholder to the real element it stands in for.\n\n-   Content finished loading but there's genuinely nothing to show? Use `EmptyState`.\n-   Need a small, announced, indeterminate busy indicator (not a layout stand-in)? Use `Spinner`, or\n    `Progress` for a determinate bar.\n\nPick `variant` by the shape you're standing in for:"
    }
  ],
  "usage": [
    {
      "variant": "text",
      "use": "A line of copy — headings, labels, body runs. Set width to the expected text length."
    },
    {
      "variant": "circle",
      "use": "A round element — avatars, icon bubbles. Match width and height."
    },
    {
      "variant": "rectangle",
      "use": "A block — cards, images, thumbnails, buttons. The default."
    }
  ],
  "examples": [],
  "source": "packages/design-system/src/components/primitives/Skeleton/Skeleton.mdx",
  "status": "local-preview",
  "note": "Guidance is read from local documentation, originally imported from the frozen source. Platform assertions in guidance are not parity verification."
}

## Contract and public API

```json
{
  "props": [
    {
      "name": "variant",
      "type": "SkeletonVariant | undefined",
      "declared_type": "SkeletonVariant",
      "required": false,
      "description": "Shape preset: corner radius for all three, plus a 16px height for `text`. Defaults to `rectangle`.",
      "source": {
        "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
        "line": 13
      },
      "values": [
        "circle",
        "rectangle",
        "text"
      ],
      "values_complete": true,
      "default": "'rectangle'",
      "default_kind": "source-expression"
    },
    {
      "name": "width",
      "type": "string | number | undefined",
      "declared_type": "number | string",
      "required": false,
      "description": "Width as a number (px) or any CSS length.",
      "source": {
        "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
        "line": 15
      }
    },
    {
      "name": "height",
      "type": "string | number | undefined",
      "declared_type": "number | string",
      "required": false,
      "description": "Height as a number (px) or any CSS length.",
      "source": {
        "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
        "line": 17
      }
    },
    {
      "name": "borderRadius",
      "type": "string | number | undefined",
      "declared_type": "number | string",
      "required": false,
      "description": "Corner radius override (number = px); otherwise the variant default applies.",
      "source": {
        "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
        "line": 19
      }
    },
    {
      "name": "className",
      "type": "string | undefined",
      "declared_type": "string",
      "required": false,
      "description": "",
      "source": {
        "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
        "line": 20
      }
    },
    {
      "name": "style",
      "type": "React.CSSProperties | undefined",
      "declared_type": "React.CSSProperties",
      "required": false,
      "description": "",
      "source": {
        "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
        "line": 21
      }
    },
    {
      "name": "testId",
      "type": "string | undefined",
      "declared_type": "string",
      "required": false,
      "description": "Selector on the placeholder — it is `aria-hidden`, so there is no role or name to query by.",
      "source": {
        "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
        "line": 23
      }
    }
  ],
  "prop_shapes": {},
  "api": {
    "method": "typescript-type-checker",
    "typescript_version": "5.9.3",
    "public_export": "Skeleton",
    "public_path": "Skeleton",
    "import_path": "@cloakedinc/design-system",
    "root_kind": "component",
    "entrypoints": [
      {
        "name": "Skeleton",
        "signature": 1,
        "visibility": "public",
        "source": {
          "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
          "line": 30
        },
        "props_type": "SkeletonProps",
        "props": [
          {
            "name": "variant",
            "type": "SkeletonVariant | undefined",
            "declared_type": "SkeletonVariant",
            "required": false,
            "description": "Shape preset: corner radius for all three, plus a 16px height for `text`. Defaults to `rectangle`.",
            "source": {
              "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
              "line": 13
            },
            "values": [
              "circle",
              "rectangle",
              "text"
            ],
            "values_complete": true,
            "default": "'rectangle'",
            "default_kind": "source-expression"
          },
          {
            "name": "width",
            "type": "string | number | undefined",
            "declared_type": "number | string",
            "required": false,
            "description": "Width as a number (px) or any CSS length.",
            "source": {
              "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
              "line": 15
            }
          },
          {
            "name": "height",
            "type": "string | number | undefined",
            "declared_type": "number | string",
            "required": false,
            "description": "Height as a number (px) or any CSS length.",
            "source": {
              "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
              "line": 17
            }
          },
          {
            "name": "borderRadius",
            "type": "string | number | undefined",
            "declared_type": "number | string",
            "required": false,
            "description": "Corner radius override (number = px); otherwise the variant default applies.",
            "source": {
              "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
              "line": 19
            }
          },
          {
            "name": "className",
            "type": "string | undefined",
            "declared_type": "string",
            "required": false,
            "description": "",
            "source": {
              "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
              "line": 20
            }
          },
          {
            "name": "style",
            "type": "React.CSSProperties | undefined",
            "declared_type": "React.CSSProperties",
            "required": false,
            "description": "",
            "source": {
              "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
              "line": 21
            }
          },
          {
            "name": "testId",
            "type": "string | undefined",
            "declared_type": "string",
            "required": false,
            "description": "Selector on the placeholder — it is `aria-hidden`, so there is no role or name to query by.",
            "source": {
              "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
              "line": 23
            }
          }
        ],
        "branches": [],
        "constraints": [],
        "extraction_status": "extracted"
      }
    ],
    "type_sources": [
      {
        "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
        "line": 5,
        "name": "SkeletonVariant",
        "code": "export type SkeletonVariant = 'text' | 'circle' | 'rectangle';"
      },
      {
        "path": "packages/design-system/src/components/primitives/Skeleton/Skeleton.tsx",
        "line": 11,
        "name": "SkeletonProps",
        "code": "export interface SkeletonProps {\n    /** Shape preset: corner radius for all three, plus a 16px height for `text`. Defaults to `rectangle`. */\n    variant?: SkeletonVariant;\n    /** Width as a number (px) or any CSS length. */\n    width?: number | string;\n    /** Height as a number (px) or any CSS length. */\n    height?: number | string;\n    /** Corner radius override (number = px); otherwise the variant default applies. */\n    borderRadius?: number | string;\n    className?: string;\n    style?: React.CSSProperties;\n    /** Selector on the placeholder — it is `aria-hidden`, so there is no role or name to query by. */\n    testId?: string;\n}"
      }
    ],
    "defaults_policy": "Only explicit destructured parameter initializers are extracted. Other runtime defaults remain in implementation source."
  },
  "spec": {
    "$schema": "../../../specs/component-spec.schema.json",
    "identity": {
      "name": "Skeleton",
      "status": "preview",
      "version": "1.0.0",
      "summary": "A decorative shimmer placeholder that preserves the expected text, avatar, or block layout while content loads."
    },
    "parts": [
      {
        "id": "placeholder",
        "label": "Placeholder",
        "description": "Owns the requested dimensions, shape, and loading shimmer."
      },
      {
        "id": "base",
        "label": "Base layer",
        "description": "Provides the resting loading surface."
      },
      {
        "id": "highlight",
        "label": "Highlight layer",
        "description": "Moves across the base to communicate ongoing loading."
      }
    ],
    "allowedDesignChoices": {
      "variants": {
        "text": {
          "label": "Text"
        },
        "circle": {
          "label": "Circle"
        },
        "rectangle": {
          "label": "Rectangle"
        }
      },
      "sizes": {}
    },
    "variants": [
      {
        "id": "text",
        "label": "Text",
        "description": "A 16-unit line placeholder with a compact radius.",
        "platforms": [
          "ios",
          "android",
          "web"
        ]
      },
      {
        "id": "circle",
        "label": "Circle",
        "description": "A fully round placeholder for an avatar or circular icon.",
        "platforms": [
          "ios",
          "android",
          "web"
        ]
      },
      {
        "id": "rectangle",
        "label": "Rectangle",
        "description": "A rounded block placeholder for cards, media, or larger content.",
        "platforms": [
          "ios",
          "android",
          "web"
        ]
      }
    ],
    "sizes": [],
    "measurements": [
      {
        "id": "text-height",
        "label": "Text placeholder height",
        "kind": "exact",
        "token": "--cds-size-16",
        "value": 16,
        "unit": "px",
        "appliesTo": [
          "placeholder",
          "text"
        ]
      },
      {
        "id": "text-radius",
        "label": "Text placeholder radius",
        "kind": "exact",
        "token": "--cds-radius-xxs",
        "value": 4,
        "unit": "px",
        "appliesTo": [
          "placeholder",
          "text"
        ]
      },
      {
        "id": "rectangle-radius",
        "label": "Rectangle placeholder radius",
        "kind": "exact",
        "token": "--cds-radius-xs",
        "value": 8,
        "unit": "px",
        "appliesTo": [
          "placeholder",
          "rectangle"
        ]
      }
    ],
    "layout": {
      "alignment": "The placeholder occupies the exact box requested by its parent.",
      "flow": "It is a block-shaped decorative replacement for one expected content region.",
      "notes": [
        "Set width and height to match the content being reserved; circle placeholders need equal dimensions."
      ]
    },
    "typographyAndColor": {
      "typography": [
        {
          "label": "Text-line reference",
          "description": "The default text placeholder height aligns with the body text size.",
          "token": "--cds-type-body-size"
        }
      ],
      "colors": [
        {
          "label": "Base",
          "description": "Uses the theme-aware skeleton base role.",
          "token": "--cds-skeleton-base"
        },
        {
          "label": "Highlight",
          "description": "Uses the theme-aware skeleton highlight role.",
          "token": "--cds-skeleton-highlight"
        }
      ]
    },
    "states": [
      {
        "id": "loading",
        "label": "Loading",
        "description": "Shows the moving shimmer between base and highlight colors."
      },
      {
        "id": "reduced-motion",
        "label": "Reduced motion",
        "description": "Shows the same placeholder without shimmer animation."
      },
      {
        "id": "custom-geometry",
        "label": "Custom geometry",
        "description": "Uses caller-provided dimensions or radius while retaining the selected shape semantics."
      }
    ],
    "behavior": [
      {
        "label": "Layout preservation",
        "description": "Reserve the approximate geometry of the content that will replace the placeholder."
      },
      {
        "label": "Decoration only",
        "description": "Do not use Skeleton as a determinate progress indicator or status message."
      }
    ],
    "accessibility": [
      {
        "label": "Hidden placeholder",
        "description": "Hide the decorative shape from assistive technology."
      },
      {
        "label": "Busy region",
        "description": "When loading must be announced, mark the containing region busy or provide separate status copy."
      }
    ],
    "contentAdaptation": [
      {
        "label": "Shape matching",
        "description": "Use text for a text run, circle for a round identity or icon, and rectangle for a larger block."
      },
      {
        "label": "Unknown content",
        "description": "Avoid over-specific placeholder layouts when the eventual content shape is not known."
      }
    ],
    "motionHaptics": {
      "motion": [
        {
          "label": "Shimmer",
          "description": "Move the highlight across the base while loading and stop it for reduced motion."
        }
      ],
      "haptics": [
        {
          "label": "No feedback",
          "description": "Skeleton is non-interactive and does not request haptic feedback."
        }
      ]
    },
    "platformDifferences": []
  },
  "platforms": {
    "implemented": [
      "web"
    ],
    "native": "Imported design guidance only; no native implementation or parity verification in this preview.",
    "react": {
      "implementation": "local",
      "status": "preview",
      "parity": "web-reference"
    },
    "vue": {
      "implementation": "absent",
      "parity": "not-verified",
      "status": "reference-only"
    },
    "swift": {
      "implementation": "absent",
      "parity": "not-verified",
      "status": "reference-only"
    },
    "kotlin": {
      "implementation": "absent",
      "parity": "not-verified",
      "status": "reference-only"
    }
  },
  "tokens": [
    {
      "name": "--cds-size-16",
      "light": "16px",
      "dark": "16px"
    },
    {
      "name": "--cds-radius-xxs",
      "light": "4px",
      "dark": "4px"
    },
    {
      "name": "--cds-radius-xs",
      "light": "8px",
      "dark": "8px"
    },
    {
      "name": "--cds-type-body-size",
      "light": "1rem",
      "dark": "1rem"
    },
    {
      "name": "--cds-skeleton-base",
      "light": "#0b0b0a0d",
      "dark": "#ffffff0d"
    },
    {
      "name": "--cds-skeleton-highlight",
      "light": "#0b0b0a26",
      "dark": "#ffffff26"
    }
  ],
  "review": {
    "local_status": "not-reviewed",
    "source_approval": null,
    "imported_spec_status": "approved",
    "spec_origin": "imported-adapted",
    "local_spec_source_status": "approved",
    "imported_source_revision": "f96f416e1c3bfbfaffcd155a88b87b18b8bb25f1",
    "note": "Inherited specification status is provenance, not approval of the current local implementation or extracted contract."
  },
  "missing_facts": [
    {
      "code": "human-review-pending",
      "detail": "This local preview has no recorded human design or engineering sign-off."
    },
    {
      "code": "platform-parity-unverified",
      "detail": "Vue, Swift and Kotlin implementations are absent from this package; platform parity has not been verified."
    },
    {
      "code": "figma-mapping-unverified",
      "detail": "No current component-level Figma node and immutable revision have been verified for this contract."
    }
  ]
}
```

## Visual states

- [Playground](/storybook/iframe.html?id=cloaked-design-system-primitives-skeleton--playground&viewMode=story) | export: Playground | source: packages/design-system/src/components/primitives/Skeleton/Skeleton.stories.tsx

- [Rectangle](/storybook/iframe.html?id=cloaked-design-system-primitives-skeleton--rectangle&viewMode=story) | export: Rectangle | source: packages/design-system/src/components/primitives/Skeleton/Skeleton.stories.tsx

- [Text](/storybook/iframe.html?id=cloaked-design-system-primitives-skeleton--text&viewMode=story) | export: Text | source: packages/design-system/src/components/primitives/Skeleton/Skeleton.stories.tsx

- [Circle](/storybook/iframe.html?id=cloaked-design-system-primitives-skeleton--circle&viewMode=story) | export: Circle | source: packages/design-system/src/components/primitives/Skeleton/Skeleton.stories.tsx

- [Custom Radius](/storybook/iframe.html?id=cloaked-design-system-primitives-skeleton--custom-radius&viewMode=story) | export: CustomRadius | source: packages/design-system/src/components/primitives/Skeleton/Skeleton.stories.tsx

- [Styled](/storybook/iframe.html?id=cloaked-design-system-primitives-skeleton--styled&viewMode=story) | export: Styled | source: packages/design-system/src/components/primitives/Skeleton/Skeleton.stories.tsx

- [Dark Theme](/storybook/iframe.html?id=cloaked-design-system-primitives-skeleton--dark-theme&viewMode=story) | export: DarkTheme | source: packages/design-system/src/components/primitives/Skeleton/Skeleton.stories.tsx

Preview pending human sign-off. Source-derived APIs and successful checks do not certify accessibility, native parity or approval.
