Progress

v0.0.10

v0.0.10StableHeadlessStatelessAccessibleApache-2.0
Installation mix mishka.ui.gen.headless progress
Source View Source

Overview of the Phoenix and LiveView Headless Progress Component

The Mishka Chelekom Headless Progress ships zero opinionated styling - only the semantic markup, full WAI-ARIA progressbar wiring, and paired-presence state (data-indeterminate/data-progressing/data-complete). Pass value as nil for an indeterminate (loading) bar - aria-valuenow is then omitted and no fill ratio is set. Every part - label, value, track and indicator - is addressable through a *_class attribute, and the indicator exposes a --chelekom-progress CSS variable for the fill ratio, so you style it entirely with your own Tailwind classes while the accessibility keeps working underneath.

Base UI Progress example (Phoenix headless)

Base UI Progress example (Phoenix headless)

Export data 20%
heex
<.progress
  id="chelekom-headless-progress-hero"
  value={20}
  label="Export data"
  show_value
  class="grid max-w-full w-60 grid-cols-2 gap-y-2"
  label_class="text-sm font-normal text-neutral-950 dark:text-white"
  value_class="text-right text-sm text-neutral-950 dark:text-white"
  track_class="col-span-2 h-1 overflow-hidden bg-neutral-200 dark:bg-neutral-800"
  indicator_class="bg-neutral-950 transition-[width] duration-500 dark:bg-white"
/>

Parts & data attributes

Each part carries a structural chelekom-progress__* class you can target, plus the shared paired-presence status - exactly one of data-indeterminate, data-progressing or data-complete is present on the root and every part at any time.

Partdata-partState / ARIAPurpose
Root(root)role="progressbar", aria-valuemin, aria-valuemax, aria-valuenow, aria-valuetext, aria-labelledbyThe container for the whole progress bar.
LabellabelReferenced by aria-labelledbyAccessible name, rendered when the label attribute is set.
Valuevaluedata-indeterminate, data-progressing, data-completeOptional readout, rendered when show_value is set.
Tracktrackdata-indeterminate, data-progressing, data-completeThe background rail behind the indicator.
Indicatorindicatordata-indeterminate, data-progressing, data-complete, --chelekom-progressThe filled portion; carries the 0..1 fill ratio as a CSS variable.

Accessibility

Follows the WAI-ARIA Progressbar pattern: the root carries role="progressbar" with aria-valuemin, aria-valuemax, a clamped aria-valuenow and a human aria-valuetext. There is no keyboard interaction - progress bars are not focusable or operable, only announced by assistive technology.