The Gauge
component is a view used to display the current value in relation to a specified finite capacity, similar to a fuel gauge in an automobile. The Gauge
component is highly configurable and can display any combination of the current value, the range the gauge can display, and a label describing the purpose of the gauge itself. It is suitable for showing the current value of a limited capacity, such as progress, level, or quantity.
value
(Required)number
min
and max
properties.label
(Required)VirtualNode
min
(Optional)number
0
. It represents the lower bound of the gauge.max
(Optional)number
1
. It represents the upper bound of the gauge.currentValueLabel
(Optional)VirtualNode
minValueLabel
(Optional)VirtualNode
maxValueLabel
(Optional)VirtualNode
gaugeStyle
(Optional)GaugeStyle
automatic
: The default style based on the current context of the view being styled.accessoryCircular
: Displays an open circular ring with a marker that appears at a point along the ring to indicate the current value.accessoryCircularCapacity
: Displays a closed circular ring that is partially filled to indicate the current value.circular
: (Available only on watchOS) Displays an open circular ring with a marker that appears at a point along the ring to indicate the current value.linearCapacity
: Displays a bar that fills from the leading to trailing edge as the value increases.accessoryLinear
: Displays a bar with a marker that appears at a point along the bar to indicate the current value.accessoryLinearCapacity
: Displays a bar that fills from the leading to trailing edge as the value increases.linear
: (Available only on watchOS) Displays a bar with a marker that appears at a point along the bar to indicate the current value.The Gauge
component is ideal for the following use cases:
By customizing properties such as label
and currentValueLabel
, the Gauge
component can be adapted for various display needs, helping users understand the current state more clearly.
value
property should be within the range specified by min
and max
to ensure proper display.min
and max
are not provided, the gauge will default to the range [0, 1]
.gaugeStyle
options provide varied visual representations. Select an appropriate style based on the device and context to enhance user experience.