# Skeleton (Lumen Halo): prompt.md (v1.0.0)

- id: `lumen-skeleton` · version 1.0.0 · component · free
- category: Feedback
- build: Base UI (one set of files; its dependencies follow the build)
- install (this build): `npx shadcn@latest add https://beautiful-ui.dev/r/lumen-skeleton.json`
- npm dependencies: none
- registry dependencies: utils, https://beautiful-ui.dev/r/lumen-foundation.json
- docs: https://beautiful-ui.dev/components/lumen-skeleton
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

A dim cell of glass with a slow sweep of light across it while the real thing loads; it holds still under reduced motion. shadcn's Skeleton, cut from Lumen glass.

## Build it
- Stack: React 19 (`ref` is a plain prop), TypeScript, Tailwind CSS v4 utilities, a shadcn-initialised project with the `@/*` alias.
- Packages: none beyond React.
- Files: `components/ui/lumen/skeleton.tsx`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `lumen-foundation`.
- Builds: one set of files for both, but its dependencies come in Base UI and Radix builds. Install the one that matches the project (see Install): a free item's bare URL installs the Base UI build of it and its dependencies.
- Exports to keep: `Skeleton`, and every exported type.
- CSS: the install merges this item's rules (the registry `css` field) into your global stylesheet, in `@layer components`, and adds the lumen foundation (tokens, keyframes, motion levels) once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Tokens: retheme with the `--lumen-*` custom properties (`--lumen-accent`, `--lumen-accent-text`, `--lumen-bad`, `--lumen-bad-text`, `--lumen-focus`, `--lumen-good`, `--lumen-good-text`, `--lumen-hairline`, `--lumen-ink`, `--lumen-muted-ink`, `--lumen-series-1`, `--lumen-series-2`, `--lumen-series-3`, `--lumen-series-4`, `--lumen-series-5`, `--lumen-series-6`, `--lumen-warn`, `--lumen-warn-text`); this item's CSS also reads `--lumen-radius-k`. Never add Tailwind colour classes inside the component.

```tsx
import { Skeleton } from "@/components/ui/lumen/skeleton";
```

## Parts

| Part | data-slot | What it is for |
|---|---|---|
| `Skeleton` | `skeleton` | The cell. |

Style a part with `[data-slot="<slot>"]` selectors or its `className`; keep the attributes when editing.

## Sound
- Keep every `data-slot` and `data-sound` attribute: the sound layer reads them.
- Installing this item adds no audio. Nothing plays until the app mounts `GlassSoundProvider` once (install: `npx shadcn@latest add https://beautiful-ui.dev/r/glass-sound.json`, import from `@/components/beautiful-ui/glass-sound`); `GlassSoundToggle` is its mute control. Without a provider the audio engine never loads.

## Match the original
- Read `components/ui/lumen/skeleton.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when
- skeleton, loading placeholder, shimmer, shadcn skeleton, Lumen
- Holding the shape of content while it loads

### Not when
- Short waits under a second: show nothing

## Mistakes
- Match the real layout, or the page jumps when it loads

## Usage

```tsx
import { Skeleton } from "@/components/ui/lumen/skeleton";

<Skeleton className="h-4 w-40" />
```

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `className` | `string` |  | Size and round it to the shape it stands in for. |

Full docs: https://beautiful-ui.dev/components/lumen-skeleton

## Customising
- Colours: set the `--lumen-*` tokens on `:root`, or on a container with the `lumen-scope` class to retheme one area. Add the `lumen-inherit` class to follow your shadcn palette instead (`--chart-N`, `--destructive`).
- Dark mode follows the `.dark` class on an ancestor (the shadcn and next-themes convention).
- Update later by re-running the install with `--overwrite` (review the diff if you edited it). Changelog: https://beautiful-ui.dev/r/changelog.json

## Keyboard

| Keys | Action |
|---|---|
| — | Not focusable |

## Motion inventory

| Interaction | What moves |
|---|---|
| Loading | A light sweeps across every 1.6s; still under reduced motion |

## Accessibility contract (preserve when editing)
- Decorative: mark the loading region aria-busy

## Install

Base UI project (a base-* style in components.json):

```bash
npx shadcn@latest add https://beautiful-ui.dev/r/lumen-skeleton.json
```

Radix project (a radix-*, new-york or default style):

```bash
npx shadcn@latest add https://beautiful-ui.dev/r/radix-nova/lumen-skeleton.json
```

Or add the `@beautiful-ui` registry to components.json and run `npx shadcn@latest add @beautiful-ui/lumen-skeleton`: the CLI picks the build from your style.

## Credits
- Built on shadcn/ui (https://ui.shadcn.com)

## Source (Base UI build)

### components/ui/lumen/skeleton.tsx

```tsx
/**
 * Skeleton (Lumen Halo) v1.0.0 · Beautiful UI
 * Docs: https://beautiful-ui.dev/components/lumen-skeleton · Agent prompt: https://beautiful-ui.dev/md/lumen-skeleton.md
 * Licensed to the purchaser under the Beautiful UI license: https://beautiful-ui.dev/license
 */
import type * as React from "react";
import { cn } from "@/lib/utils";

/*
 * Lumen Skeleton. shadcn's Skeleton in Lumen Halo: a dim cell of glass with a slow sweep of light
 * across it, instead of a pulse; it holds still under reduced motion. Same export and data-slot as
 * shadcn; server-safe.
 */

function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
  return <div data-slot="skeleton" className={cn(`lumen-skeleton`, className)} {...props} />;
}

export { Skeleton };
```

### CSS (the registry `css` / `cssVars`, merged into the global stylesheet by the shadcn CLI)

```css
@layer components {
  @keyframes lumen-sweep {
    from {
      background-position: 150% 0;
    }
    to {
      background-position: -50% 0;
    }
  }
  .lumen-skeleton {
    border-radius: calc(8px * var(--lumen-radius-k, 1));
    background: color-mix(in srgb,var(--gc-ink) 7%,transparent) linear-gradient(100deg,transparent 30%,color-mix(in srgb,var(--gc-ink) 7%,transparent) 50%,transparent 70%) 0 0/200% 100% no-repeat;
    animation: lumen-sweep 1.6s ease-in-out infinite;
  }
  @media (prefers-reduced-motion: reduce) {
    .lumen-skeleton {
      animation: none;
    }
  }
}
```

The lumen foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://beautiful-ui.dev/r/lumen-foundation.json.
