Bar
Bar(
props):Element
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
props |
{ className?: string; classNames?: BarClassNames; color?: string; label: string; maximum: number; reserved?: number; showValue?: boolean; size?: "base" | "sm" | "lg" | "xl" | BarSize; value: number; } |
- |
props.className? |
string |
An override on the track, over size, such as w-full. |
props.classNames? |
BarClassNames |
An override per part, over className for the track. |
props.color? |
string |
A CSS colour the fill draws in, such as a resource’s. Left out, it is the health tone, which a game restyles through its token. |
props.label |
string |
The accessible name, such as “Health”. |
props.maximum |
number |
The full value. It must be positive. |
props.reserved? |
number |
How much of the maximum is held back past value, such as the mana a cast has reserved: drawn after the fill as a lighter band of its colour. |
props.showValue? |
boolean |
Reads the value out beside the bar, 12 / 40, tabular and small. |
props.size? |
"base" | "sm" | "lg" | "xl" | BarSize |
How large it draws, such as BarSize.ExtraLarge for a boss’s bar. |
props.value |
number |
The current value. The bar clamps it between 0 and maximum. |
Returns
Section titled “Returns”Element