This documentation is under construction. Pages can be missing or change at any time. Follow it on GitHub.

Skip to content

Progress

Displays the status of a task that takes a long time.

This example sends events to the server: PHP runs in your browser.

API reference#

Import the components of the family:

use Phem\Ui\Progress;
use function Phem\Ui\{ProgressLabel, ProgressValue, ProgressTrack, ProgressIndicator};

Progress#

A progress bar: Base UI Progress.Root. A null value is an indeterminate progress.

All the parts get data-indeterminate, data-progressing or data-complete. Give an id to label the bar with its ProgressLabel.

The text of the value is the rounded percent (24%). The format options (style, currency, minimumFractionDigits, maximumFractionDigits) and the locale change it, as in Base UI: see ValueFormat. They need the intl extension of PHP.

PropTypeDefault
value?floatnull
minfloat0
maxfloat100
id?stringnull
formatarray[]
locale?stringnull
children?Htmlnull
...attrsarray[]

ProgressLabel#

The label of the progress bar. It names the progress bar (aria-labelledby).

PropTypeDefault
children?Htmlnull
...restmixed—

ProgressValue#

The text of the value. Its children replace the default text (a percent).

PropTypeDefault
children?Htmlnull
...restmixed—

ProgressTrack#

The bar of the progress: it holds the ProgressIndicator.

PropTypeDefault
children?Htmlnull
...restmixed—

ProgressIndicator#

The part of the track that shows the progress: its width is the percentage of the value.

PropTypeDefault
...restmixed—

The source of the examples: examples/ui/Progress.phem.

Phem
Esc
↑↓ to navigate↵ to openEsc to close