Skip to content
Liquidify
HomeDocsComponentsExamplesPlayground
⌘K
(opens in new tab)
Liquidify

Accessible React controls with a CSS and SVG material engine.

Product

ComponentsExamplesPlaygroundPackages

Learn

DocumentationGetting startedConceptsAI resources

Project

CommunityShowcaseVersionsGitHub

Independent open-source software. Not affiliated with or endorsed by Apple Inc.

LicenseBrand

Component catalog

Browse the public controls by interaction purpose. Every result links to generated API facts, accessibility behavior, source, and exhaustive stories.

Gauge

Show a scalar value positioned inside a bounded range (default 0…1) as an arc or bar — a speedometer, a battery, a load meter.

import { Gauge } from "@liquidify/react/gauge"

Overview

Basic Gauge

A focused starting point showing Gauge with its essential configuration.

API

PropTypeDefaultDescription
classNamestring | undefined—Optional additional CSS class merged into the glass surface class. The supported per-instance customisation seam: override any `--lq-*` custom property from this class's CSS — the token cascade the engine reads (ADR-0004). No raw inline style is involved, so this stays ADR-0003 clean.
currentValueLabelReactNode—Formatted current value (SwiftUI `currentValueLabel: () -> View`). Rendered visibly on the two marker/accessory styles (leading the line on `accessoryLinear`, large and centred on `accessoryCircular`); not rendered on the two capacity styles (unexercised by the reference). When its content is a plain `string`/`number`, it also drives `aria-valuetext` so assistive tech announces the formatted value (e.g. `"68%"`) rather than a bare number.
label
required
ReactNode—The primary descriptor (SwiftUI `label: () -> Label`, required) — the accessible name source. Rendered visibly on the two **capacity** styles (above the bar / centred in the ring); folded into the accessible name only (via a visually-hidden node) on the two **marker/accessory** styles, where the reference shows no visible `label` glyph. A string/number renders through the `Text` primitive; a `ReactNode` passes through the `TextLabel` guard unwrapped (ADR-0028). A caller supplying a visually-empty `label` (e.g. a bare tint swatch) **must** also supply an explicit `aria-label` — Gauge does not synthesize a name from `tint` / `variant`.
labelPropsLabelProps | undefined—Per-instance typography override for the primary {@link GaugeProps.label} (ADR-0028, charter §2). Token-backed axes only; spread **last** onto the internal `Text` so an explicit value wins over the component's computed default. Applies to the visible label on `linearCapacity` (`.lq-gauge-label`) and `accessoryCircularCapacity` (`.lq-gauge-ring-label`). Has no effect on the two marker/accessory styles, where `label` renders visually-hidden.
maxnumber | undefined1Upper bound of the range (SwiftUI `in: lower...upper`).
maximumValueLabelReactNode—Upper-bound caption (SwiftUI `maximumValueLabel: () -> View`). Same placement rule as {@link GaugeProps.minimumValueLabel}.
minnumber | undefined0Lower bound of the range (SwiftUI `in: lower...upper`).
minimumValueLabelReactNode—Lower-bound caption (SwiftUI `minimumValueLabel: () -> View`). Rendered only by `accessoryCircular` in the reference, flanking below {@link GaugeProps.currentValueLabel}.
refRef<HTMLDivElement> | undefined—Forwarded ref to the rendered element — the component's native root (or the merged child element on a component that opts into {@link SlottableProps}). Generic over `E` (charter `docs/api-conventions.md` §4 rule 1, default `HTMLElement`) so a component with a polymorphic root (Link's navigation / action mode union, Text's `as`) can instantiate the concrete element per variant instead of leaving every consumer with a widened `Ref<HTMLElement>`. A component that does not narrow simply inherits the `HTMLElement` default — source-compatible with every pre-existing non-generic `extends ControlProps`.
tintLiquidTintValue | undefined—System-accent of the capacity fill (SwiftUI `.tint(_:)`), drawn from the restricted {@link LIQUID_COLORS } palette. Meaningful **only** on the two capacity styles (`linearCapacity`, `accessoryCircularCapacity`); the two marker/accessory styles always render monochrome primary and ignore this prop. When omitted on a capacity style, the fill resolves to `--lq-color-accent` (SwiftUI's default, system blue).
value
required
number—The current value, positioned within `[min, max]`. Out-of-range values are clamped (never extrapolated past the track/arc ends) and the clamped bound — not the raw prop — is what `aria-valuenow` reports.
valuePropsLabelProps | undefined—Per-instance typography override for {@link GaugeProps.currentValueLabel} (charter §2 rule 3). Token-backed axes only; spread **last** onto the internal `Text` so an explicit value wins over the component's computed default. Applies to `accessoryLinear` (`.lq-gauge-current`) and `accessoryCircular` (`.lq-gauge-arc-current`). {@link GaugeProps.minimumValueLabel} / {@link GaugeProps.maximumValueLabel} carry no override seam.
variantGaugeStyle | undefinedlinearCapacityVisual style — verbatim SwiftUI `.gaugeStyle(_:)` member spelling.

Guidelines

Do
  • Use Gauge when its semantics match the content or action.
  • Keep labels concise, specific, and consistent with the surrounding interface.
  • Test the component with keyboard navigation, zoom, and both color schemes.
Don't
  • Do not use Gauge as a visual substitute for a different semantic element.
  • Do not rely on color or an icon alone to communicate essential meaning.
  • Do not override the component tokens with fixed values unless the product theme requires it.

Accessibility

Gauge preserves the semantics of its content and should be given a clear accessible label when its visible content does not provide one.

Keyboard
  • Use meaningful visible text whenever possible.
  • Mark purely decorative imagery as hidden from assistive technology.
  • Verify reading order at increased text sizes.

Tokens

NameValue
--lq-color-accent#007aff
--lq-color-label-primaryComponent-defined value
--lq-color-label-secondaryComponent-defined value
--lq-color-separatorrgba(60, 60, 67, 0.14)
--lq-color-system-#ff383c#ff4245#e9152d#ff6165#ff8d28#ff9230#c55300#ffa056#ffcc00#ffd600#a16a00#fedf43
--lq-color-system-blue-default-dark#0091ff
--lq-color-system-blue-default-light#0088ff
--lq-duration-standard250ms
--lq-easing-standardcubic-bezier(0.25, 0.1, 0.25, 1)
--lq-gauge-arc-sweep230deg
--lq-gauge-bar-hvar(--lq-space-8)
--lq-gauge-line-hvar(--lq-space-8)
--lq-gauge-padvar(--lq-space-16)
--lq-gauge-ring-dvar(--lq-space-64)
--lq-gauge-ring-strokevar(--lq-space-8)
--lq-gauge-ring-sweep360deg
--lq-gauge-tick-dvar(--lq-gauge-line-h, var(--lq-space-8))
--lq-glass-440.71.15var(--lq-segmented-control-indicator-blur)calc(var(--lq-glass-material-blur) * 8)var(--lq-shadow-presentational)
--lq-radius-pill9999rem
--lq-space-0.0625rem0.125rem0.25rem0.5rem0.75rem1rem1.25rem1.5rem2rem2.5rem3rem3.5rem

Key features

  • Liquid material

    Uses Liquidify surfaces and theme-aware design tokens.

  • Typed API

    Provides a typed React API with generated prop documentation.

  • Accessible by default

    Preserves semantic structure, focus visibility, and assistive-technology state.

Resources

  • Source
  • Markdown
  • JSON
  • Storybook
Components