Working Indicator
A live "work in progress" line: animated mark, shimmering label, trailing dots and elapsed time.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
label | string | — | Text of the line. Defaults to "Working" when neither messages nor slotted content is given. |
messages | string[] | undefined | undefined | Labels to rotate through while running, e.g. ["Scheming","Pondering"]. Overrides label while running. |
indicator | WorkingIndicatorIndicator | glyph | Animated mark before the label: glyph, dots, ring, pulse, orbit or none. |
effect | WorkingIndicatorEffect | shimmer | How the label animates while running: shimmer, wave, pulse, fill or none. |
ellipsis | WorkingIndicatorEllipsis | fade | Trailing dots: fade, bounce, static (a still "…") or none. |
state | WorkingIndicatorState | running | running, paused (animations and counter freeze), done or error. |
done-label | string | — | Label shown in the done and error states, e.g. "Schemed for 14s". Defaults to the running label. |
elapsed | boolean | false | Shows the time spent running after the label. |
started | number | undefined | undefined | Start of the work as a millisecond timestamp, so a re-rendered line keeps counting from the real start. |
value | number | undefined | undefined | Progress between 0 and max. Makes the line a progress bar; the fill effect then fills to this fraction. |
max | number | 100 | Value that fills the whole label. |
Slots
| Name | Description |
|---|---|
(default) | Label content, used instead of label/messages. The wave effect needs plain label text to split into letters. |
indicator | Custom indicator replacing the built-in one while the work is running or paused. |
done-icon | Mark shown in the done state. Defaults to a check. |
error-icon | Mark shown in the error state. Defaults to a cross. |
meta | Supporting text after the label and the elapsed time, e.g. "esc to interrupt". |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
indicator | Box around the built-in indicator, the indicator slot that replaces it, and the done-icon and error-icon slots. |
label | Text container of the label: it wraps the label text, or the default slot content that replaces it. |
ellipsis | The trailing dots. |
meta | Container placed after the label, wrapping the elapsed time and the meta slot. |
elapsed | The elapsed-time counter. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-working-indicator--gap | pixel | 8px | Space between the indicator, the label and the meta text. |
--c2-working-indicator--font-size | font-size | 14px | |
--c2-working-indicator--font-weight | font-weight | 500 | |
--c2-working-indicator__indicator--color | color | #0265dc | Colour of the running indicator. |
--c2-working-indicator__indicator--size | pixel | 16px | Width and height of the indicator box. |
--c2-working-indicator__indicator--animation-duration | time | 1.2s | One indicator cycle; the glyph takes twice as long, so each of its ten frames shows for a fifth of it. |
--c2-working-indicator__label--color | color | #71717a | Resting colour of the label. |
--c2-working-indicator__label--highlight-color | color | #18181b | Shimmer band, wave crest and filled part of the label. |
--c2-working-indicator__label--animation-duration | time | 2s | One shimmer, wave, pulse or fill cycle. |
--c2-working-indicator__label--stagger | time | 0.06s | Delay between two letters of the wave effect. |
--c2-working-indicator__label--rotate-duration | time | 3s | How long each of the messages stays on screen. |
--c2-working-indicator__ellipsis--animation-duration | time | 1.4s | One cycle of the trailing dots. |
--c2-working-indicator__meta--color | color | #71717a | Colour of the elapsed time and the meta text. |
--c2-working-indicator__meta--font-size | font-size | 12px | |
--c2-working-indicator__done--color | color | #16a34a | Colour of the done mark. |
--c2-working-indicator__error--color | color | #dc2626 | Colour of the error mark. |