SusCellBar

Segmented resource bar — HP/MP cells split into discrete blocks; fill color via USS token classes only.
Package
SusKit · Atoms (commercial)
SusKit · Atoms
Props
| Name | Type | Default | |
|---|---|---|---|
Value | Prop<float> | 0f | |
Max | Prop<float> | 100f | |
SegmentCount | Prop<int> | 10 | |
Color | Prop<string> | "primary" |
Slots
No slots.
Events
No public events.
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
sus-cell-barsus-cell-bar__cellsus-cell-bar__cell--emptysus-cell-bar__cell--fullsus-cell-bar__cell--gapsus-cell-bar__cell--partialsus-cell-bar__fillsus-cell-bar__fill--pct-10sus-cell-bar__fill--pct-20sus-cell-bar__fill--pct-30sus-cell-bar__fill--pct-40sus-cell-bar__fill--pct-50sus-cell-bar__fill--pct-60sus-cell-bar__fill--pct-70sus-cell-bar__fill--pct-80sus-cell-bar__fill--pct-90sus-cell-bar__rowsus-cell-bar--color-dangersus-cell-bar--color-infosus-cell-bar--color-primarysus-cell-bar--color-secondarysus-cell-bar--color-successsus-cell-bar--color-warning
Usage
xml
<template>
<sus:SusCellBar :Value="Hp.Value"
Max="100"
SegmentCount="10"
Color="danger" />
</template>
<script>
public Prop<float> Hp = new(64f);
</script>csharp
var hpBar = new SusCellBar();
hpBar.Max.Value = 100f;
hpBar.SegmentCount.Value = 10;
hpBar.Color.Value = "success";
hpBar.Value.Value = 80f;Color
primary · secondary · success · danger · warning · info
Notes
- Segments fill left-to-right by the proportion of
Value/Max; a partially-filled segment uses a discrete 10% USS width bucket (sus-cell-bar__fill--pct-N), not an inline style — same "no C# style API" rule as the rest of the kit. SegmentCountchanges rebuild the whole row; keep it stable per bar instance rather than animating it.Colorpicks the USS token class for both full cells and the partial-fill overlay — swap tokens in your theme USS rather than styling from C#.