Status & Feedback
Progress
Progress shows how far a task has advanced — aligned with Radix-style bars and shadcn/ui patterns. Explain what is happening, what changed and what someone can do next. Pair visual status with language that still makes sense without its color. Import it from @/components/kamod-ui/progress.
Source · Design reference · API reference · Theming · Styles
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthInstallation
Import Progress from @/components/kamod-ui/progress.
pnpm add @kamod-ch/uiCopy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.
Usage
Pass value and optional max for determinate progress. Use value={null} or indeterminate for loading when completion is unknown — the indeterminate animation is injected once with the component (no extra Tailwind keyframes). Pair with labels, or drive value from a Slider for interactive demos.
import { Progress } from "@kamod-ch/ui";Choose a complete composition from the examples below; required child components and props vary by pattern.
Component Examples & Variants
Explore Progress in Different Contexts, from the starting pattern to the compositions below. Begin with Basic, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.
Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.
Basic
Show a Measurable Amount of Completed Work. Pass a known progress value to display completion along a themed track. The bar gives a quick visual measure, while the surrounding label should identify the operation whose progress is being reported.
Supply an accessible name and a nearby explanation of what is progressing; use Indeterminate when the total cannot be known reliably.
import { Progress } from "@kamod-ch/ui";
export const Example = () => <Progress value={33} class="w-full max-w-md" />;Label
Explain the Number as Well as the Fill. Place a concise operation label and numeric readout beside the progress bar. Derive the number and bar from the same value so readers receive one consistent account of how much work is complete.
Derive both from the same value and max, and communicate completion or failure explicitly rather than leaving a full bar as the only final message.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthControlled
Explore How State Drives the Visual Result. Use a Slider to change the progress value in this demonstration. Both controls read the same state, making it easy to inspect the visual response before replacing the slider with real task progress.
Try the extremes and a mid-range value, then connect the same readout to a real task. Keep pending, completed and failed states distinguishable; a full bar should reflect completed work rather than merely the end of an animation.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthIndeterminate
Communicate Activity without Inventing a Percentage. Use a null value or indeterminate when the operation is active but completion cannot be measured. This signals ongoing work without presenting an invented percentage or implying a known time remaining.
Switch to determinate progress only when a meaningful total becomes available, and provide a final result so continuous movement does not leave users wondering whether the task finished.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthCustom Max
Use Units that Match the Work. Set max to the total count when progress represents steps, files or other units rather than a percentage. The current value and its text explanation should use the same scale as that maximum.
Update the total if more work is discovered and decide how that change should appear to the user. A label such as 3 of 8 files communicates the scale more clearly than a bare number detached from its unit.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthProps and Data
Configure Progress using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.
Props, slots and variants for this component.
Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.
Component Props
? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.Progress
ProgressProps
| Prop / type | Description |
|---|---|
class | Configure
|
indeterminate | When true, shows an animated indeterminate bar regardless of `value`.
|
indicatorClass | Configure
|
max | Configure
|
value | Set to `null` for an indeterminate bar (Radix-style). Ignored when `indeterminate` is true.
|
Data Type Reference
Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.
Progress Props
4 declared fieldsProgressPropsProgress.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of ProgressProps before adapting it.Accessibility
Progress exposes role="progressbar". Determinate values default to 0 with a maximum of 100 and are clamped to the valid range. value={null} or indeterminate omits the current numeric value and supplies an indeterminate value description.
Connect It to Your Data
Feed completed from the task and pass a positive total once it is known. Until then, value={null} means the duration is unknown. Reaching the maximum means the measured steps finished, not that the server accepted the result.
import { Progress } from "@kamod-ch/ui";
type TaskProgressProps = { completed: number; total: number | null };
export function TaskProgress({ completed, total }: TaskProgressProps) {
const knownTotal = total !== null && Number.isFinite(total) && total > 0;
const current = knownTotal ? Math.min(total, Math.max(0, completed)) : 0;
const label = knownTotal ? `${current} of ${total} items` : "Preparing items…";
return (
<div class="grid gap-2">
<p>{label}</p>
<Progress
value={knownTotal ? current : null}
max={knownTotal ? total : 100}
aria-label="Processing items"
aria-valuetext={label}
/>
</div>
);
}You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.
Connect the Foundation
Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.
Build the Surrounding Screen
Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.
Make the Result Hold Up
Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.
Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.