Skip to main content

Progressbar

Visual progress indicator.

Usage

<w-progressbar value="60" max="100" label="Upload progress">
<w-slot fill><div></div></w-slot>
</w-progressbar>

Props

PropTypeDefaultDescription
valuenumber0Current value
minnumber0Minimum value
maxnumber100Maximum value
labelstring""Accessible label

Slots

SlotElementDescription
fillElementThe progress fill bar

Styling

The library sets the indicator's width via the --w-fill custom property on the host (updated on every value change). You only style appearance.

w-progressbar {
height: 8px;
background: #e0e0e0;
border-radius: 4px;
overflow: hidden;
}

w-progressbar w-slot[dot] > * {
height: 100%;
background: #6366f1;
transition: width 0.3s;
}

/* Indeterminate progress */
w-progressbar[indeterminate] w-slot[dot] > * {
width: 30%;
animation: indeterminate 1.5s infinite linear;
}
SelectorTargets
w-progressbar[indeterminate]Indeterminate progress (no value)
w-progressbar w-slot[dot] > *The fill bar (width set via --w-fill)
--w-fillCurrent fill percentage (set by library)

Accessibility

  • role="progressbar" with aria-valuenow, aria-valuemin, aria-valuemax
  • aria-label from label prop