Progress
A milled channel filling with accent — indeterminate state sweeps instead of pretending to know the total.
@emboss/progress
Bouncing mix
Installation
pnpm dlx shadcn@latest add @emboss/progressUsage
import { Progress } from "@/components/ui/progress";
export function Example() {
return <Progress value={64} aria-label="Transfer" />;
}API reference
Progress
Pass value={null} for indeterminate. Label with aria-label or the ProgressLabel part.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | null | — | Current progress; null renders the indeterminate sweep. |
| min / max | number / number | 0 / 100 | Range of the channel. |
ProgressLabel / ProgressValue
Optional labelled readout parts, wired to the progressbar by the primitive.
Source
View source — progress.tsxHide source — progress.tsx
"use client";
import { Progress as BaseProgress } from "@base-ui/react/progress";
import { cn } from "@/lib/utils";
export type ProgressProps = React.ComponentProps<typeof BaseProgress.Root>;
/**
* A milled channel filling with accent. Indeterminate state runs a sweep
* along the channel instead of pretending to know the total.
*
* @example
* <Progress value={64} aria-label="Transfer" />
*/
function Progress({ className, children, ...props }: ProgressProps) {
return (
<BaseProgress.Root data-slot="progress" {...props}>
<BaseProgress.Track
data-slot="progress-track"
className={cn(
"relative block h-2 w-full overflow-hidden rounded-full bg-well-deep shadow-deboss-1",
className,
)}
>
<BaseProgress.Indicator
data-slot="progress-indicator"
className="block h-full rounded-full bg-accent shadow-flush transition-[width] duration-(--duration-settle) ease-(--ease-settle) data-indeterminate:w-2/5 data-indeterminate:animate-progress-sweep"
/>
</BaseProgress.Track>
{children}
</BaseProgress.Root>
);
}
function ProgressLabel({
className,
...props
}: React.ComponentProps<typeof BaseProgress.Label>) {
return (
<BaseProgress.Label
data-slot="progress-label"
className={cn("text-sm font-medium text-ink", className)}
{...props}
/>
);
}
function ProgressValue({
className,
...props
}: React.ComponentProps<typeof BaseProgress.Value>) {
return (
<BaseProgress.Value
data-slot="progress-value"
className={cn("font-mono text-sm text-ink-muted tabular-nums", className)}
{...props}
/>
);
}
export { Progress, ProgressLabel, ProgressValue };