Install
Pull Progress Display from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { ProgressDisplay } from "@brika/clay";import { ProgressDisplay } from "@brika/clay/components/progress-display";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
'use client';
import { ProgressDisplay } from '@brika/clay/components/progress-display';
import { useRef } from 'react';
/** In-progress state, spinner, phase label, and a live log stream. */
export default function ProgressDisplayDefaultDemo() {
const scrollRef = useRef<HTMLDivElement | null>(null);
return (
<div className="w-full max-w-md">
<ProgressDisplay
progressValue={48}
phaseLabel="Deploying to production…"
logs={[
'Building Docker image',
'Pushing to registry (sha256:a3f7…)',
'Starting container on us-east-1a',
'Health check: waiting for /healthz',
]}
scrollRef={scrollRef}
error={null}
success={false}
isProcessing
/>
</div>
);
}Progress Display, every way
Accessibility
- Log entries update via a live region, AT announces new lines as they stream in.
- Error and success states should also be communicated via a
toastoralertfor AT users in background contexts. - The scrollable log area should be reachable by keyboard when it overflows.
Theme tokens
Every CSS variable Progress Display reads, with its default and the
dotted path you'd write in a ThemeConfig JSON
to override it. Set any of these in your theme to retune Progress Display
without touching component code.
Progress Display tokens
11 tokens--progress-display-phase-foregroundcolorvar(--muted-foreground)components.progressDisplay.phaseForegroundText color of the phase label rendered above the bar.
--progress-display-log-foregroundcolorvar(--muted-foreground)components.progressDisplay.logForegroundText color of the log entries (and empty-logs message) inside the scroll area.
--progress-display-log-bgcolorcolor-mix(in oklch, var(--muted) 30%, transparent)components.progressDisplay.logBgBackground fill of the log scroll area surface.
--progress-display-spinner-colorcolorvar(--primary)components.progressDisplay.spinnerColorColor of the in-flight spinner glyph shown while processing.
--progress-display-success-colorcolorvar(--success)components.progressDisplay.successColorColor of the success indicator (check icon and progress fill) and the success block accents.
--progress-display-success-bgcolorcolor-mix(in oklch, var(--success) 10%, transparent)components.progressDisplay.successBgBackground fill of the success message block.
--progress-display-success-bordercolorcolor-mix(in oklch, var(--success) 50%, transparent)components.progressDisplay.successBorderBorder color of the success message block.
--progress-display-error-colorcolorvar(--destructive)components.progressDisplay.errorColorColor of the error indicator (X icon and progress fill) and the error block text.
--progress-display-error-bgcolorcolor-mix(in oklch, var(--destructive) 10%, transparent)components.progressDisplay.errorBgBackground fill of the error message block.
--progress-display-error-bordercolorcolor-mix(in oklch, var(--destructive) 50%, transparent)components.progressDisplay.errorBorderBorder color of the error message block.
--progress-display-backdrop-blurblur0pxcomponents.progressDisplay.backdropBlurBackdrop blur applied to the progress-display log surface. Set non-zero for a frosted-glass treatment.
Override in a theme
Authoring a theme is plain JSON. Drop overrides under
components.progressDisplay, the names
are camelCase versions of the variable suffix.
{
"id": "my-theme",
"name": "My Theme",
"description": "...",
"accentSwatches": ["#000"],
"components": {
"progressDisplay": {
"phaseForeground": "var(--muted-foreground)"
}
}
}
Then apply with applyTheme(myTheme)
(see the theming guide),
scope it to a subtree with themeToCssVars(myTheme, mode),
or consume any token directly in your own JSX with the matching Tailwind utility
(e.g. bg-progress-display-…) — see the
chips on each token row.
API reference
Props specific to Progress Display. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.
- string | nullError message; when set, the bar turns destructive and an error block is shown.
- booleanWhether work is in flight; controls the spinner and empty-state copy.
- string[]Lines rendered in the log scroll area, oldest first.
- stringShort label rendered above the bar (e.g. "Uploading…").
- numberProgress percentage from 0 to 100. Drives the bar fill width.
- RefObject<HTMLDivElement | null>Ref attached to the inner log container so callers can auto-scroll.
- booleanMarks the run as finished successfully; turns the bar green and shows a check.
- stringCopy shown when
logsis empty andisProcessingis true. - stringCopy shown in the success block when
successis true.