Skip to content

ProgressBarComponent

Official

A component that displays a progress bar.

Import:

import { ProgressBarComponent } from 'obsidian';

Signature:

export class ProgressBarComponent extends ValueComponent<number>

Extends: ValueComponent<number>

Constructor

new ProgressBarComponent(containerEl: HTMLElement)

Constructor.

To get the constructor instance, use getProgressBarComponentConstructor from obsidian-typings/implementations.

Properties

PropertyTypeDescription
lineElHTMLDivElementAccess the "line" element which is a child of the progressBar element.
progressBarHTMLDivElementAccess the "bar" element.

Methods

MethodReturnsDescription
getValue()numberGet the current value of the progress bar (0-100).
registerOptionListener(listeners, key)thisRegister an option listener.
(Inherited from ValueComponent)
setValue(value)thisSet the current value of the progress bar.
setValue(value)thisSet the value of the component.
(Inherited from ValueComponent)
setVisibility(visible)thisShows/hides the component.

Links to this page: