This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 54).
A SwiftUI Gauge component for displaying progress with visual indicators.
A gauge component for displaying values within a range using visual indicators like circular or linear gauges.
Installation
- npx expo install @expo/uiIf you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
import { Gauge, Host } from "@expo/ui/swift-ui"; <Host matchContents> <Gauge max={{ value: 1, label: '1' }} min={{ value: 0, label: '0' }} current={{ value: 0.5 }} color={[ PlatformColor('systemRed'), PlatformColor('systemOrange'), PlatformColor('systemYellow'), PlatformColor('systemGreen'), ]} type="circularCapacity" /> </Host>
See official SwiftUI documentation for more information.
API
Component
Type: React.Element<GaugeProps>
Renders a native Gauge component.
unionColor (or array of colors for gradient) of the Gauge.
Acceptable values are: ColorValue | ColorValue[]
Types
Literal Type: string
The type of Gauge.
Acceptable values are: 'default' | 'circular' | 'circularCapacity' | 'linear' | 'linearCapacity'
Value options for the Gauge component.
| Property | Type | Description |
|---|---|---|
| color(optional) | ColorValue | Color of the label. |
| label(optional) | string | Label of the element. |
| value | number | Value of the element. |