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

- id: `lumen-progress` · version 1.0.0 · component · free
- category: Feedback
- build: Base UI (this item also ships a Radix build)
- install (this build): `npx shadcn@latest add https://beautiful-ui.dev/r/lumen-progress.json`
- npm dependencies: @base-ui/react@^1
- registry dependencies: utils, https://beautiful-ui.dev/r/lumen-foundation.json
- docs: https://beautiful-ui.dev/components/lumen-progress
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

A filament of light that fills its track and glows at its tip, or with cells, a level meter whose segments light in turn, straight off a hi-fi panel. shadcn's Progress, 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: `@base-ui/react@^1` (Base UI build); `radix-ui@^1` (Radix build).
- Files: `components/ui/lumen/progress.tsx`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `lumen-foundation`.
- Builds: separate Base UI and Radix files. 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: `Progress`, `ProgressTrack / ProgressIndicator`, `ProgressLabel / ProgressValue`, 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-font-mono`, `--lumen-font-sans`, `--lumen-radius-k`. Never add Tailwind colour classes inside the component.

```tsx
import { Progress } from "@/components/ui/lumen/progress";
```

## Parts

| Part | data-slot | What it is for |
|---|---|---|
| `Progress` | `progress` | Root. |
| `ProgressTrack / ProgressIndicator` | `progress-track` | Base UI: the track and fill. |
| `ProgressLabel / ProgressValue` | `progress-label` | Base UI: the words. |

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/progress.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
- progress, progress bar, meter, upload progress, level meter, shadcn progress, Lumen
- Showing how far along something is: an import, an upload, a goal

### Not when
- Unknown durations: use Spinner

## Mistakes
- Don't use it for time that's unknown

## Usage

```tsx
import { Progress } from "@/components/ui/lumen/progress";

<Progress value={64} />
<Progress value={64} cells={16} />
```

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `value` | `number \| null` |  | 0–100; null is indeterminate (a light sweeps the track). |
| `cells` | `number` |  | Beautiful UI: draw a level meter of this many cells. |

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

## 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 |
|---|---|
| Change | The filament eases to its value; cells light left to right |
| Indeterminate | A light sweeps the track |

## Accessibility contract (preserve when editing)
- role=progressbar with value, min and max
- Label it (ProgressLabel on Base UI, aria-label on Radix)

## Install

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

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

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

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

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

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

## Source (Base UI build)

### components/ui/lumen/progress.tsx

```tsx
"use client";

/**
 * Progress (Lumen Halo) v1.0.0 · Beautiful UI
 * Docs: https://beautiful-ui.dev/components/lumen-progress · Agent prompt: https://beautiful-ui.dev/md/lumen-progress.md
 * Licensed to the purchaser under the Beautiful UI license: https://beautiful-ui.dev/license
 */

import * as React from "react";
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
import { cn } from "@/lib/utils";

/*
 * Lumen Progress (Base UI build). shadcn's Progress in Lumen Halo: a filament of light that fills
 * its track and glows at its tip, or, with `cells`, a level meter whose segments light in turn (the
 * hi-fi panel's meter). No value is indeterminate: a light sweeps the track. Same exports, parts and
 * data-slots as shadcn; `cells` is Beautiful UI's.
 */

function Progress({ className, children, value, min = 0, max = 100, cells, ...props }: ProgressPrimitive.Root.Props & { /** Draw the track as this many cells (a level meter) instead of a filament. */ cells?: number }) {
  return (
    <ProgressPrimitive.Root value={value} min={min} max={max} data-slot="progress" className={cn(`lumen-progress lumen-control`, className)} {...props}>
      {children}
      <ProgressTrack data-cells={cells ? "" : undefined}>
        {cells ? <ProgressCells value={value} min={min} max={max} count={cells} /> : <ProgressIndicator />}
      </ProgressTrack>
    </ProgressPrimitive.Root>
  );
}

function ProgressCells({ value, min, max, count }: { value: number | null | undefined; min: number; max: number; count: number }) {
  const n = Math.max(1, Math.round(count));
  // The same range the root announces: min..max, not a fixed 0..100.
  const f = value == null || max <= min ? 0 : Math.min(1, Math.max(0, (value - min) / (max - min)));
  const lit = Math.ceil(f * n);
  return (
    <span aria-hidden className={`lumen-progress-cells`} style={{ "--n": n } as React.CSSProperties}>
      {Array.from({ length: n }, (_, i) => (
        <i key={i} data-on={i < lit ? "" : undefined} data-tip={i === lit - 1 ? "" : undefined} style={{ "--i": i } as React.CSSProperties} />
      ))}
    </span>
  );
}

function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) {
  return <ProgressPrimitive.Track data-slot="progress-track" className={cn(`lumen-progress-track`, className)} {...props} />;
}

function ProgressIndicator({ className, ...props }: ProgressPrimitive.Indicator.Props) {
  return <ProgressPrimitive.Indicator data-slot="progress-indicator" className={cn(`lumen-progress-indicator`, className)} {...props} />;
}

function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {
  return <ProgressPrimitive.Label data-slot="progress-label" className={cn(`lumen-progress-label`, className)} {...props} />;
}

function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {
  return <ProgressPrimitive.Value data-slot="progress-value" className={cn(`lumen-progress-value`, className)} {...props} />;
}

export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue };
```

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

```css
@layer components {
  @keyframes lumen-progress-sweep {
    from {
      transform: translateX(-100%);
    }
    to {
      transform: translateX(250%);
    }
  }
  .lumen-progress {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    width: 100%;
  }
  .lumen-progress-track {
    position: relative;
    display: flex;
    flex-basis: 100%;
    align-items: center;
    height: 4px;
    overflow: hidden;
    border-radius: calc(99px * var(--lumen-radius-k, 1));
    background: color-mix(in srgb,var(--gc-ink) 9%,transparent);
  }
  .lumen-progress-indicator {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg,color-mix(in srgb,var(--gc-acc) 55%,transparent),var(--gc-acc));
    box-shadow: 0 0 10px color-mix(in srgb,var(--gc-acc) 55%,transparent);
    transition: width calc(0.6s * var(--gcp-k)) cubic-bezier(.22,1,.36,1),transform calc(0.6s * var(--gcp-k)) cubic-bezier(.22,1,.36,1);
  }
  .lumen-progress:is([data-indeterminate],[data-state="indeterminate"]) .lumen-progress-indicator {
    width: 40%;
    animation: lumen-progress-sweep 1.4s ease-in-out infinite;
  }
  .lumen-progress-track[data-cells],.lumen-progress[data-cells] {
    height: auto;
    overflow: visible;
    background: none;
  }
  .lumen-progress-cells {
    display: grid;
    grid-template-columns: repeat(var(--n),minmax(0,1fr));
    gap: 3px;
    width: 100%;
  }
  .lumen-progress-cells>i {
    height: 8px;
    border-radius: calc(2px * var(--lumen-radius-k, 1));
    background: var(--gc-cellOff);
    transition: background calc(.3s * var(--gcp-k)) ease calc(var(--i) * 18ms * var(--gcp-k)),box-shadow calc(.3s * var(--gcp-k)) ease;
  }
  .lumen-progress-cells>i[data-on] {
    background: var(--gc-acc);
  }
  .lumen-progress-cells>i[data-tip] {
    box-shadow: 0 0 8px color-mix(in srgb,var(--gc-acc) 70%,transparent);
  }
  .lumen-progress-label {
    font: 500 13px/1.3 var(--lumen-font-sans, var(--font-sans, var(--font-geist, var(--font-geist-sans, 'Geist')))), system-ui, sans-serif;
    color: var(--gc-ink);
  }
  .lumen-progress-value {
    margin-inline-start: auto;
    font: 500 12px/1.3 var(--lumen-font-mono, var(--font-mono, var(--font-geist-mono, 'Geist Mono'))), ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    color: var(--gc-sec);
  }
  @media (prefers-reduced-motion: reduce) {
    .lumen-progress .lumen-progress-indicator {
      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.
