import { Skeleton } from "@replicas/ui";

export default function SkeletonDemo() {
  return (
    <div style={{ display: "flex", alignItems: "center", gap: 12, width: 280 }}>
      <Skeleton variant="circle" width={32} height={32} />
      <div style={{ display: "flex", flexDirection: "column", gap: 6, flex: 1 }}>
        <Skeleton width="60%" />
        <Skeleton width="90%" />
      </div>
    </div>
  );
}

Examples

Variants

<Skeleton variant="default" />
<Skeleton variant="pill" />
<Skeleton variant="rounded" />
<Skeleton variant="squared" />

Card Placeholder

function CardPlaceholder() {
  return (
    <div style={{ display: "flex", flexDirection: "column", gap: 8, width: 280 }}>
      <Skeleton variant="rect" height={120} />
      <Skeleton width="70%" />
      <Skeleton width="40%" />
    </div>
  );
}

Prompt

Copy Prompt hands your agent everything it needs to build the Skeleton in the Geist style: the measured tokens, the CSS and the structure.

Show Prompt
# Geist Skeleton

A placeholder shape shown while content loads.

Build a Skeleton in this project that looks and behaves like Geist's. Measured from the running Geist app (vercel.com/geist). Keep every value exact. Map the tokens onto the project's own theme variables instead of hard-coding them. Use the project's own component library for behaviour, or Base UI primitives if it has none.

Fidelity: Partly measured from Geist's Skeleton. No reference has been captured yet.

## Variants

- `variant`: `default`, `pill`, `rounded`, `squared`

## Tokens

| Token | Light | Dark |
| --- | --- | --- |
| `--ds-gray-100` | `hsl(0 0% 95%)` | `hsl(0 0% 10%)` |
| `--ds-gray-200` | `hsl(0 0% 92%)` | `hsl(0 0% 12%)` |
| `--duration-skeleton` | `1.5s` | `1.5s` |
| `--radius-rounded` | `9999px` | `9999px` |

## CSS

Scoped under `[data-style="geist"]`; dark rules sit under `[data-theme="dark"]`. The `ui-*` classes and data attributes match the structure below.

```css
[data-style="geist"] {
  .ui-skeleton {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 5px;
    background-color: var(--ds-gray-100);

    &::after {
      content: "";
      position: absolute;
      inset: 0 -200% 0 0;
      background-image: linear-gradient(
        to right,
        var(--ds-gray-100),
        var(--ds-gray-200),
        var(--ds-gray-100)
      );
      background-size: 50% 100%;
      animation: geist-skeleton-shimmer var(--duration-skeleton) ease-in-out infinite reverse;
    }
  }

  .ui-skeleton:is([data-variant="pill"], [data-variant="rounded"], [data-variant="circle"]) {
    border-radius: var(--radius-rounded);
  }

  .ui-skeleton[data-variant="squared"] {
    border-radius: 0;
  }

  @media (prefers-reduced-motion: reduce) {
    .ui-skeleton::after {
      animation: none;
    }
  }
}

@keyframes geist-skeleton-shimmer {
  to {
    transform: translateX(-50%);
  }
}
```

## Structure

How Replicas assembles it on Base UI.

```tsx
import type { ComponentProps, CSSProperties } from "react";
import { join } from "./utils";

export type SkeletonProps = ComponentProps<"span"> & {
  variant?: string;
  width?: CSSProperties["width"];
  height?: CSSProperties["height"];
};

export function Skeleton({ className, variant = "text", width, height, style, ...props }: SkeletonProps) {
  return (
    <span
      aria-hidden
      className={join("ui-skeleton", className)}
      data-variant={variant}
      style={{ width, height, ...style }}
      {...props}
    />
  );
}
```

## Example

```tsx
import { Skeleton } from "@replicas/ui";

export default function SkeletonDemo() {
  return (
    <div style={{ display: "flex", alignItems: "center", gap: 12, width: 280 }}>
      <Skeleton variant="circle" width={32} height={32} />
      <div style={{ display: "flex", flexDirection: "column", gap: 6, flex: 1 }}>
        <Skeleton width="60%" />
        <Skeleton width="90%" />
      </div>
    </div>
  );
}
```

## Foundations

The rest of the Geist style, as a skill: https://replicas.raphaelsalaja.com/skills/geist/SKILL.md