Progress
Displays an indicator showing the completion progress of a task in determinate or indeterminate mode.
Progress displays task completion across a bounded numeric range and supports an indeterminate state when completion percentage is unknown. The examples on this page use the Shadcn Rhea style preset.
Preview
Section titled “Preview”<div class="w-[60%]">
<wc-shadcn-progress-root
style-profile="rhea"
id="hero-progress"
aria-label="Task progress"
value="13"
value-text="13%"
>
<wc-shadcn-progress-track style-profile="rhea">
<wc-shadcn-progress-indicator
style-profile="rhea"
></wc-shadcn-progress-indicator>
</wc-shadcn-progress-track>
</wc-shadcn-progress-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const el = document.querySelector('#hero-progress');
setTimeout(() => {
if (el instanceof HTMLElement)
setElementProps(el, { value: 66, valueText: '66%' });
}, 500);
</script>Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases. After registering the package entry, import the parts from @proto.ui/prototypes-shadcn/progress:
import { progressRoot, progressLabel, progressTrack, progressIndicator, progressValue,} from '@proto.ui/prototypes-shadcn/progress';Compose Root, Track, and Indicator for a minimal bar. To display an inline header row above the track, place Label and Value before Track:
<ShadcnProgressRoot styleProfile="rhea" value={56} valueText="56%" className="w-full max-w-sm"> <ShadcnProgressLabel styleProfile="rhea">Upload progress</ShadcnProgressLabel> <ShadcnProgressValue styleProfile="rhea" /> <ShadcnProgressTrack styleProfile="rhea"> <ShadcnProgressIndicator styleProfile="rhea" /> </ShadcnProgressTrack></ShadcnProgressRoot>ProgressRoot├── ProgressLabel├── ProgressValue└── ProgressTrack └── ProgressIndicator- Range and indeterminate mode:
valueclamps to[min, max](equal bounds evaluate to0%). Omittingvalueor settingindeterminate={true}enters indeterminate mode and omitsaria-valuenow. - Style presets and RTL: Supports
styleProfile(vega,nova,maia,lyra,mira,luma,sera,rhea,new-york-v4/new-york, orinherit) plusdir="ltr" | "rtl"with logical inline-end alignment (ms-auto). - Accessibility and exposed state: Progress is a passive read-only display with no keyboard tab stop. Every part exposes synchronized
value,percentage,indeterminate, andstatusstates, with--pui-percentagedriving smooth reduced-motion-aware width transitions.
Examples
Section titled “Examples”Use ProgressLabel and ProgressValue to render an inline label and readout above the progress bar.
<wc-shadcn-progress-root
style-profile="rhea"
class="w-full max-w-sm"
value="56"
value-text="56%"
>
<wc-shadcn-progress-label style-profile="rhea">
Upload progress
</wc-shadcn-progress-label>
<wc-shadcn-progress-value
style-profile="rhea"
></wc-shadcn-progress-value>
<wc-shadcn-progress-track style-profile="rhea">
<wc-shadcn-progress-indicator
style-profile="rhea"
></wc-shadcn-progress-indicator>
</wc-shadcn-progress-track>
</wc-shadcn-progress-root>Controlled
Section titled “Controlled”A progress bar controlled interactively by a Slider.
<div class="flex w-full max-w-sm flex-col gap-4">
<wc-shadcn-progress-root
style-profile="rhea"
id="controlled-progress"
value="50"
value-text="50%"
>
<wc-shadcn-progress-label style-profile="rhea">
Completion
</wc-shadcn-progress-label>
<wc-shadcn-progress-value
style-profile="rhea"
></wc-shadcn-progress-value>
<wc-shadcn-progress-track style-profile="rhea">
<wc-shadcn-progress-indicator
style-profile="rhea"
></wc-shadcn-progress-indicator>
</wc-shadcn-progress-track>
</wc-shadcn-progress-root>
<wc-shadcn-slider-root
style-profile="rhea"
id="controlled-slider"
value="50"
min="0"
max="100"
step="1"
aria-label="Progress value"
>
<wc-shadcn-slider-track style-profile="rhea">
<wc-shadcn-slider-indicator
style-profile="rhea"
></wc-shadcn-slider-indicator>
<wc-shadcn-slider-thumb
style-profile="rhea"
></wc-shadcn-slider-thumb>
</wc-shadcn-slider-track>
</wc-shadcn-slider-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const progress = document.querySelector('#controlled-progress');
const slider = document.querySelector('#controlled-slider');
if (
progress instanceof HTMLElement &&
slider instanceof HTMLElement
) {
slider.addEventListener('valueChange', (event) => {
const next = Math.round(event.detail.value);
setElementProps(slider, { value: next });
setElementProps(progress, {
value: next,
valueText: `${next}%`,
});
});
}
</script>Indeterminate
Section titled “Indeterminate”Use indeterminate when the completion percentage is unknown, then transition smoothly back to a determinate value once progress is measurable.
<wc-shadcn-progress-root
style-profile="rhea"
class="w-full max-w-sm"
indeterminate
>
<wc-shadcn-progress-label style-profile="rhea">
Syncing workspace…
</wc-shadcn-progress-label>
<wc-shadcn-progress-value
style-profile="rhea"
></wc-shadcn-progress-value>
<wc-shadcn-progress-track style-profile="rhea">
<wc-shadcn-progress-indicator
style-profile="rhea"
></wc-shadcn-progress-indicator>
</wc-shadcn-progress-track>
</wc-shadcn-progress-root>Pass dir="rtl" alongside localized labels and valueText for right-to-left scripts such as Arabic and Hebrew.
<wc-shadcn-progress-root
style-profile="rhea"
dir="rtl"
value="56"
value-text="٥٦٪"
class="w-full max-w-sm"
>
<wc-shadcn-progress-label style-profile="rhea">
تقدم الرفع
</wc-shadcn-progress-label>
<wc-shadcn-progress-value
style-profile="rhea"
></wc-shadcn-progress-value>
<wc-shadcn-progress-track style-profile="rhea">
<wc-shadcn-progress-indicator
style-profile="rhea"
></wc-shadcn-progress-indicator>
</wc-shadcn-progress-track>
</wc-shadcn-progress-root>| Prop | Type | Default |
|---|---|---|
value | number undefined | omitted (indeterminate) |
min | number | 0 |
max | number | 100 |
indeterminate | boolean | false |
ariaLabel | string | '' |
valueText | string | '' |
dir | 'ltr' 'rtl' undefined | inherited |
styleProfile | ShadcnStyleChoice | inherit → nearest scope → luma |
Sub-parts and exposed states
Section titled “Sub-parts and exposed states”ProgressLabel,ProgressTrack,ProgressIndicator, andProgressValueeach accept an optionalstyleProfileoverride.- All parts expose synchronized read-only states:
value(number),percentage(number,0–100),indeterminate(boolean), andstatus('indeterminate' | 'loading' | 'complete').