import { KbqProgressBarModule } from '@koobiq/components/progress-bar';

KbqProgressBar

componentCopy link to KbqProgressBar

Horizontal indicator of the progress of an operation.

@Component({ selector: 'kbq-progress-bar' })
class KbqProgressBar extends KbqColorDirective {
    readonly id = input<string>(`kbq-progress-bar-${idIterator++}`);
    readonly value = input<number>(0);
    readonly mode = input<ProgressBarMode>('determinate');
    readonly ariaLabel = input<string | null>(null, {
        alias: 'aria-label'
    });
    readonly color = input<T | null | undefined>();
    get colorClassName(): string;
    setDefaultColor(color: T): void;
}
idinputCopy link to idstring

Id of the host element. Generated when not supplied.

valueinputCopy link to valuenumber

Share of the work that is done, in the [0, 100] range. Ignored in indeterminate mode.

modeinputCopy link to modeProgressBarMode

Whether the bar reports value, or an operation whose duration is unknown.

aria-labelinputCopy link to aria-labelstring | null

Accessible name of the bar. Takes precedence over a projected [kbq-progress-bar-text]; when neither is given, the bar falls back to the progressBar name from the a11y locale.

colorinputCopy link to colorT | null | undefined

Color of the component. A value set in code holds until the input changes, and the default color is used while both are unset or falsy.

colorClassNameCopy link to colorClassNamestring

current class name of color

setDefaultColor()Copy link to setDefaultColor()void

this color will be used as a default value. For example [color]="'' | false | undefined | null".

KbqProgressBarCaption

directiveCopy link to KbqProgressBarCaption

Caption projected below the bar. Describes the bar for assistive tech: KbqProgressBar points its aria-describedby at this element.

@Directive({ selector: '[kbq-progress-bar-caption]' })
class KbqProgressBarCaption {
    readonly id = input<string>(
        `kbq-progress-bar-caption-${captionIdIterator++}`
    );
}
idinputCopy link to idstring

Element id. Generated when not supplied, so the bar can always reference it.

KbqProgressBarText

directiveCopy link to KbqProgressBarText

Label projected above the bar. Names the bar for assistive tech: KbqProgressBar points its aria-labelledby at this element.

@Directive({ selector: '[kbq-progress-bar-text]' })
class KbqProgressBarText {
    readonly id = input<string>(
        `kbq-progress-bar-text-${textIdIterator++}`
    );
}
idinputCopy link to idstring

Element id. Generated when not supplied, so the bar can always reference it.

ProgressBarMode

typeCopy link to ProgressBarMode

Whether the bar reports a known share of the work, or an operation whose duration is unknown.

type ProgressBarMode = 'determinate' | 'indeterminate';
Suggestions for improvement
If you found a mistake or want to improve the article, create an issue on GitHub.