CngxProgress
projects/ui/feedback/loading/progress.ts
Import#
import { CngxProgress } from '@cngx/ui/feedback'
Description#
Progress indicator atom - determinate or indeterminate.
Automatically switches between modes based on whether progress is defined:
- Indeterminate (
progress === undefined) - animated line, no value - Determinate (
progress0–100) - bar with percentage
CSS transition on bar width (300ms ease-out) smooths jumpy updates.
aria-valuenow is only present in determinate mode - AT uses its
absence to distinguish the two modes.
With async state
<cngx-progress [state]="uploadState" label="File upload" [showLabel]="true" />Manual progress
<cngx-progress [progress]="percent()" label="Processing" />Metadata#
Host#
Relationships
Used by4
Index#
Inputs#
Bind an async state - reads progress() for determinate mode.
HostBindings#
| Binding | Expression |
|---|---|
[class.cngx-progress--linear] | variant() === "linear" |
[class.cngx-progress--circular] | variant() === "circular" |
[class.cngx-progress--determinate] | isDeterminate() |
[class.cngx-progress--indeterminate] | !isDeterminate() |
[attr.aria-valuemin] | isDeterminate() ? 0 : null |
[attr.aria-valuemax] | isDeterminate() ? 100 : null |
[attr.aria-valuenow] | ariaValueNow() |
[attr.aria-valuetext] | ariaValueText() |
[attr.aria-label] | label() |
Default visuals for CngxProgress. The host carries .cngx-progress
and renders either linear (__track + __fill + __label) or
circular (__circle + __circle-track + __circle-fill +
centered __label) markup. The cngx-pulse keyframe is
duplicated identically in loading-indicator.css so each file is
self-contained under styleUrl bundling.
State modifiers
--indeterminate- replaces the determinate width / dashoffset transition withcngx-progress-indeterminate(linear sweep) orcngx-progress-spin(circular spin). Underprefers-reduced-motionboth fall back tocngx-pulseand the linear fill pins towidth: 100%
Variants
--linear- flex row of bar + trailing label--circular- inline-flex centered SVG ring with overlaid label
Slots
.cngx-progress__track- linear bar track.cngx-progress__fill- linear bar fill (width-bound).cngx-progress__circle- circular SVG, rotated-90degso the stroke starts at the top.cngx-progress__circle-track- background ring stroke.cngx-progress__circle-fill- active arc (stroke-dashoffsetbound to value).cngx-progress__label- trailing label (linear) or absolutely- positioned center label (circular)
The cngx-progress-spin keyframe rotates 270deg (not 360deg)
and is renamed from the original cngx-spin to avoid a global-
keyframe collision with loading-indicator.css under
encapsulation: None.
Index#
Layout
Motion
Layout
<length>8pxGap between the progress track and the trailing label slot.
Surface
<color>oklch(0 0 0 / 0.1)Track color (the unfilled portion).
Motion
<time>300msDuration of the width / dashoffset transition for the determinate fill.
*ease-outEasing curve of the determinate transition.
<time>1.5sDuration of the indeterminate animation sweep.
*ease-in-outEasing curve of the indeterminate animation.
Typography
*0.625remFont-size of the circular-variant centered label.