About this set
Four everyday progress bar layouts that cover most settings pages, course dashboards and task lists. Label above puts the name on the left and the percentage on the right over a thin 8 pixel bar, as in a profile completion prompt. Sizes, value beside shows 4, 8, 10 and 16 pixel bars with the number right-aligned in a fixed-width column, so a stack of bars lines up. Label inside prints the value in white inside a 26 pixel fill that never gets narrower than its own text, which keeps a value like 8% readable. Colours by status gives the fill and the status word one colour each for in progress, complete, paused and failed, with the status also written out in words so colour is not the only signal. Every bar is a div with role=”progressbar”, aria-valuenow, aria-valuemin, aria-valuemax and a visible label tied to it with aria-labelledby. The width comes from one custom property, –v, set from 0 to 100 in the style attribute, so there is no script: change –v and aria-valuenow together and the bar follows.
What’s included
- Label above, value beside, label inside and status variants
- Four heights from 4 to 16 pixels
- Width from one --v custom property, no JavaScript
- role="progressbar" with aria-valuenow, aria-valuetext and a visible label
- Status shown in words as well as colour
- Plain CSS, Bootstrap .progress and Tailwind versions of the same design
Accessibility
Each bar has role="progressbar" with aria-valuenow, aria-valuemin and aria-valuemax, and is named by its visible label through aria-labelledby or by an aria-label. Bars with extra context, such as 18 of 25 lessons or paused, carry it in aria-valuetext, and the duplicate visible percentages are hidden from screen readers so the value is not read twice. Fills are at least 3:1 against the track and all text meets 4.5:1. The only motion is a width transition, which is switched off under prefers-reduced-motion.
Customise it
Change --pb-accent, --pb-track and --pb-h on .pb in the plain CSS version. In Bootstrap set --bs-progress-height, --bs-progress-bg and --bs-progress-bar-bg on .progress, and --bs-success-rgb, --bs-warning-rgb and --bs-danger-rgb for the status colours. In Tailwind edit the pb- theme colours and the h- and w- utilities.






