Skip to main content

Level Indicator

shadow

Komponent Level Indicator je element umožňujúci zobraziť úroveň alebo pokrok v procese. Môže byť použitý na zobrazenie úrovne nabitia batérie, pokroku používateľa alebo iných podobných úloh.

Základné použitie

Colorize

Pridaním atribútu colorize sa pruhy indikátora sfarbia podľa úrovne (nízka, stredná, vysoká).

Sírka pruhov indikátora

Nastavením CSS premennej --wje-level-indicator-width na ľubovoľnú hodnotu je možné nastaviť šírku pruhov indikátora.

Reverse

Pridaním atribútu reverse sa pruhy indikátora zobrazia v opačnom poradí.

Atribúty a Vlastnosti

level

DescriptionSets the current indicator level. The value is limited to a range from 0 to the number of bars.
Attributelevel
Typenumber
Default1

swarms

DescriptionSpecifies the number of bars in the indicator. The minimum value is 1.
Attributeswarms
Typenumber
Default3

colorize

DescriptionIf set to true, the bars will be colored according to the level (low, medium, high).
Attributecolorize
Typeboolean
Defaultfalse

reverse

DescriptionIf set to true, the order of the bars will be reversed.
Attributereverse
Typeboolean
Defaultfalse

Eventy

No events available for this component.

Metódy

updateBars

DescriptionUpdates the class of each lane element based on the specified level.
Signature(level: number, bars: any[]) => void

getColor

DescriptionDetermines the color indicator based on a given level and number of bars.
Signature(level: number, bars: number) => string | undefined

CSS Shadow Parts

NameDescription
nativeRefers to the main div container of the level indicator.

CSS Custom Vlastnosti

NameDescription
--wje-level-indicator-color-lowColour for low level indicator.
--wje-level-indicator-color-mediumThe colour for the middle level of the indicator.
--wje-level-indicator-color-highColour for high level indicator.
--wje-level-indicator-colorThe basic colour of the indicator bars.
--wje-level-indicator-color-activeThe colour of the active indicator bars.
--wje-level-indicator-heightHeight of indicator bars.
--wje-level-indicator-widthIndicator width.
--wje-level-indicator-border-radiusRounding the corners of the indicator bars.
--wje-level-indicator-opacityTransparency of inactive indicator bars.

Sloty

NameDescription
``The default slot for the contents of the level indicator.