Components
Gauge
Gauge shows a current value within a bounded range, matching SwiftUI's summary-style meter while keeping standard progressbar semantics.
Example
Requires React 18.2+ or 19 and shared styles. See setup.
Default
Loading preview…
Code
'use client';
import { Gauge } from '@swiftuijs/ui';
export default function Example() {
return (<Gauge label="Storage" value={64} min={0} max={128} currentValueLabel="64 GB" minimumValueLabel="0 GB" maximumValueLabel="128 GB"></Gauge>);
}Usage and limitations
- Use
labelto name the gauge for both UI and accessibility. minimumValueLabelandmaximumValueLabelhelp explain the range.
API reference
| Prop | Type | Required | Description |
|---|---|---|---|
label | ReactNode | No | The primary label for the gauge. |
value | number | Yes | The current gauge value. |
min | number | No | The lower bound of the gauge range. Default: 0 |
max | number | No | The upper bound of the gauge range. Default: 1 |
currentValueLabel | ReactNode | No | Optional label describing the current value. |
minimumValueLabel | ReactNode | No | Optional label for the minimum edge of the range. |
maximumValueLabel | ReactNode | No | Optional label for the maximum edge of the range. |
Inherits additional props from Omit<IBaseElementComponent<'div'>, 'children'>.