Progress
Progress visualizes completion, loading, or capacity state.
@duskmoon-dev/components/progress Usage
When to use
- Use it to clarify state, metadata, content hierarchy, or loading without creating a new workflow.
- Pair it with semantic content so visual treatment never becomes the only source of meaning.
Implementation notes
Features
Focuses on status, metadata, empty/loading states, or content grouping without owning application state.
Uses DuskMoon tokens so the component follows the active docs theme.
Progress is most often configured through `color`, `size`, `indeterminate`, `percent`.
Renders determinate progress with default classes
Feature Demos
Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.
Colors
Progress supports the full semantic color palette: primary, secondary, tertiary, accent, neutral, base, info, success, warning, error.
import "@duskmoon-dev/components/styles.css";
import { Progress } from "@duskmoon-dev/components/progress";
const colors = [
"primary",
"secondary",
"tertiary",
"accent",
"neutral",
"base",
"info",
"success",
"warning",
"error"
] as const;
export function ProgressColorsDemo() {
return (<div style={{ display: "grid", gap: 10 }}>
{colors.map((color) => (
<Progress key={color} color={color} percent={72} showInfo />
))}
</div>);
} Basic usage
Import the component stylesheet and Progress from its package subpath, then render it with the core props.
import "@duskmoon-dev/components/styles.css";
import { Progress } from "@duskmoon-dev/components/progress";
export function Example() {
return (<Progress
percent={68}
showInfo
color="success"
size="lg"
/>);
} Renders determinate progress with default classes
test-backedProgress scenario from the component test coverage: renders determinate progress with default classes.
import "@duskmoon-dev/components/styles.css";
import { Progress } from "@duskmoon-dev/components/progress";
export function ProgressRendersDeterminateProgressWithDemo() {
return (<Progress
percent={68}
showInfo
color="success"
size="lg"
/>);
} Clamps percentage values
test-backedProgress scenario from the component test coverage: clamps percentage values.
import "@duskmoon-dev/components/styles.css";
import { Progress } from "@duskmoon-dev/components/progress";
export function ProgressClampsPercentageValuesDemo() {
return (<Progress
percent={68}
showInfo
color="success"
size="lg"
/>);
} Applies color, size, and indeterminate classes
test-backedProgress scenario from the component test coverage: applies color, size, and indeterminate classes.
import "@duskmoon-dev/components/styles.css";
import { Progress } from "@duskmoon-dev/components/progress";
export function ProgressAppliesColorSizeAndDemo() {
return (<Progress
percent={68}
showInfo
color="success"
size="lg"
/>);
} Renders formatted progress info
test-backedProgress scenario from the component test coverage: renders formatted progress info.
import "@duskmoon-dev/components/styles.css";
import { Progress } from "@duskmoon-dev/components/progress";
export function ProgressRendersFormattedProgressInfoDemo() {
return (<Progress
percent={68}
showInfo
color="success"
size="lg"
/>);
} Applies custom className
test-backedProgress scenario from the component test coverage: applies custom classname.
import "@duskmoon-dev/components/styles.css";
import { Progress } from "@duskmoon-dev/components/progress";
export function ProgressAppliesCustomClassNameDemo() {
return (<Progress
percent={68}
showInfo
color="success"
size="lg"
/>);
} Theme aware
Docs previews inherit the DuskMoon data-theme value. Use the header switch to compare light and dark rendering.
<div data-theme="sunshine">
<Progress
percent={68}
showInfo
color="success"
size="lg"
/>
</div>
<div data-theme="moonlight">
<Progress
percent={68}
showInfo
color="success"
size="lg"
/>
</div> API
The API reference below lists every parsed exported type or interface for Progress. Start with `color`, `size`, `indeterminate`, `percent` for common usage.
packages/components/src/components/progress/Progress.types.ts
Scenarios: packages/components/src/components/progress/Progress.test.tsx | Prop | Type | Required | Description |
|---|---|---|---|
color | ProgressColor | No | color configures Progress. |
size | ProgressSize | No | size configures Progress. |
indeterminate | boolean | No | indeterminate configures Progress. |
percent | number | No | percent configures Progress. |
showInfo | boolean | No | showInfo configures Progress. |
format | (percent: number) => React.ReactNode | No | format configures Progress. |
| "primary" | "secondary" | "tertiary" | "accent" | "neutral" | "base" | "info" | "success" | "warning" | "error" "sm" | "md" | "lg" | "xl"