#Overview
The <RemainingGauge />
provides a visual representation of the available product quantity,
indicating how many items remain for purchase.
Name | Type | Default | Description | Controls |
---|---|---|---|---|
label * | ReactNode | - | Label text above the gauge | |
value * | number | - | The value visually represented with the gaugae. Range from 0 to 1 (inclusive) | |
shortage | boolean | - | Highlighting state, for low amount remaining, or sold out |
#Full availability
Show codeHide code
<RemainingGauge
value={1}
label={
<>
<strong>100</strong> out of 100 available
</>
}
/>;
#Half availability
Show codeHide code
<RemainingGauge
value={0.5}
label={
<>
<strong>50</strong> out of 100 available
</>
}
/>;
#Only a few available
Show codeHide code
<RemainingGauge
value={0.02}
label={
<>
<strong>2</strong> out of 100 available
</>
}
shortage
/>;
#Sold out
Show codeHide code
<RemainingGauge
value={0}
label={
<>
<strong>Gone</strong> 100 sold
</>
}
/>;
#Colors
- Token
BAR_BACKGROUND
#0001#fff2#0001#fff2BAR_BACKGROUND_FEW
#0001#fff2#0001#fff2BAR_BACKGROUND_SOLDOUT
#0001#fff2#0001#fff2REMAINING_BACKGROUND
#7c4#8d6#059#fffREMAINING_BACKGROUND_FEW
#e64#f75#e02#f55TEXT
#000#fff#059#fffTEXT_FEW
#c42#f75#e02#f55TEXT_SOLDOUT
#000#fff#059#fff