Brutalist Progress
Display determinate completion progress or an indeterminate loading state in Brutalist style.
Brutalist Progress displays task completion or an indeterminate loading state with 5px rounded-base corners, a 2px black-bordered track, and a high-contrast accent fill bar.
Preview
Section titled “Preview”<div class="w-[60%]">
<wc-brutalist-progress-root
id="hero-progress"
aria-label="Task progress"
value="13"
value-text="13%"
>
<wc-brutalist-progress-track>
<wc-brutalist-progress-indicator></wc-brutalist-progress-indicator>
</wc-brutalist-progress-track>
</wc-brutalist-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. Import the parts from @proto.ui/prototypes-brutalist/progress:
import { progressRoot, progressLabel, progressTrack, progressIndicator, progressValue,} from '@proto.ui/prototypes-brutalist/progress';Place Label and Value before Track to align the label and percentage on a single header row above the bar. Labels use DM Sans font-sans font-medium and preserve original text casing:
<BrutalistProgressRoot value={56} valueText="56%" className="w-full max-w-sm"> <BrutalistProgressLabel>Upload progress</BrutalistProgressLabel> <BrutalistProgressValue /> <BrutalistProgressTrack> <BrutalistProgressIndicator /> </BrutalistProgressTrack></BrutalistProgressRoot>ProgressRoot├── ProgressLabel├── ProgressValue└── ProgressTrack └── ProgressIndicator- Bounds and indeterminate mode:
valueclamps to[min, max](equal bounds produce0%). Omittingvalueor settingindeterminate={true}enters indeterminate mode and omitsaria-valuenow. - Passive display: Progress adds no keyboard tab stop; updating
Rootprops keepsvalue,percentage,indeterminate, andstatussynchronized across all parts.
Examples
Section titled “Examples”Use ProgressLabel and ProgressValue to render an inline label and value readout above the track.
<wc-brutalist-progress-root
class="w-full max-w-sm"
value="56"
value-text="56%"
>
<wc-brutalist-progress-label>
Upload progress
</wc-brutalist-progress-label>
<wc-brutalist-progress-value></wc-brutalist-progress-value>
<wc-brutalist-progress-track>
<wc-brutalist-progress-indicator></wc-brutalist-progress-indicator>
</wc-brutalist-progress-track>
</wc-brutalist-progress-root>Controlled
Section titled “Controlled”A Brutalist progress bar controlled interactively by a Slider.
<div class="flex w-full max-w-sm flex-col gap-4">
<wc-brutalist-progress-root
id="controlled-progress"
value="50"
value-text="50%"
>
<wc-brutalist-progress-label>
Completion
</wc-brutalist-progress-label>
<wc-brutalist-progress-value></wc-brutalist-progress-value>
<wc-brutalist-progress-track>
<wc-brutalist-progress-indicator></wc-brutalist-progress-indicator>
</wc-brutalist-progress-track>
</wc-brutalist-progress-root>
<wc-brutalist-slider-root
id="controlled-slider"
value="50"
min="0"
max="100"
step="1"
aria-label="Progress value"
>
<wc-brutalist-slider-track>
<wc-brutalist-slider-indicator></wc-brutalist-slider-indicator>
<wc-brutalist-slider-thumb></wc-brutalist-slider-thumb>
</wc-brutalist-slider-track>
</wc-brutalist-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 completion percentage is not yet known, then toggle back to a determinate bar once measured.
<wc-brutalist-progress-root class="w-full max-w-sm" indeterminate>
<wc-brutalist-progress-label>
Building assets…
</wc-brutalist-progress-label>
<wc-brutalist-progress-value></wc-brutalist-progress-value>
<wc-brutalist-progress-track>
<wc-brutalist-progress-indicator></wc-brutalist-progress-indicator>
</wc-brutalist-progress-track>
</wc-brutalist-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 |
Label, Track, Indicator, and Value declare no props of their own; all parts expose synchronized value, percentage, indeterminate, and status states.