Reference version

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.

iOS

A gauge component for displaying values within a range using visual indicators like circular or linear gauges.

Installation

Terminal
npx expo install @expo/ui

If 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

Gauge

iOS 16.0+

Type: React.Element<GaugeProps>

Renders a native Gauge component.

GaugeProps

color

iOS 16.0+
Optional • Literal type: union

Color (or array of colors for gradient) of the Gauge.

Acceptable values are: ColorValue | ColorValue[]

current

iOS 16.0+

Current value options.

label

iOS 16.0+
Optional • Type: string

A label displayed on the Gauge.

labelColor

iOS 16.0+
Optional • Type: ColorValue

Color of the label.

max

iOS 16.0+
Optional • Type: ValueOptions

Maximum value options.

min

iOS 16.0+
Optional • Type: ValueOptions

Minimum value options.

type

iOS 16.0+
Optional • Type: GaugeType

The type of Gauge.

Types

GaugeType

iOS

Literal Type: string

The type of Gauge.

Acceptable values are: 'default' | 'circular' | 'circularCapacity' | 'linear' | 'linearCapacity'

ValueOptions

iOS

Value options for the Gauge component.

PropertyTypeDescription
color(optional)ColorValue

Color of the label.

label(optional)string

Label of the element.

valuenumber

Value of the element.