ZoomIndicator

Updated: Sep 24, 2026
ZoomIndicator is a vertical pill — a filled bar above, an icon at the bottom — that reports the zoom level currently in effect for a camera or media view. Like its horizontal sibling VolumeIndicator, it exists for transient feedback: show it while the level moves, remove it once the interaction or command that changed it has settled.
It is display-only. It never takes focus, handles no input, and does not change the zoom; you supply the value. When the user is meant to adjust something directly, reach for SliderBar or IsolatedControl instead.

Usage

import { ZoomIndicator } from '@wearables-ui-toolkit/mrbd';

const FILL_HEIGHT = { height: '100%' } as const;

type Props = {
  zoom: number;
  maxZoom: number;
  isAdjusting: boolean;
};

export function ZoomOverlay({ zoom, maxZoom, isAdjusting }: Props) {
  if (!isAdjusting) {
    return null;
  }

  return (
    <div className="zoom-overlay">
      <ZoomIndicator
        value={zoom}
        minimumValue={1}
        maximumValue={maxZoom}
        animated
        style={FILL_HEIGHT}
        aria-label="Camera zoom"
      />
    </div>
  );
}
.zoom-overlay {
  position: absolute;
  top: var(--uit-spacing-large);
  bottom: var(--uit-spacing-large);
  right: var(--uit-spacing-large);
  display: flex;
  align-items: stretch;
}
The pill has a fixed width and sizes its height to its content, subject to a minimum bar height. Because style is merged over the component’s own container styles, setting a height there is the reliable way to stretch it down the side of an overlay.
Drop the glyph when the surrounding interface already says what is being scaled, and keep the label on the pill so the level is still identifiable:
import { ZoomIndicator } from '@wearables-ui-toolkit/mrbd';

type Props = {
  magnification: number;
  maxMagnification: number;
};

export function BareZoomTrack({ magnification, maxMagnification }: Props) {
  return (
    <ZoomIndicator
      value={magnification}
      minimumValue={1}
      maximumValue={maxMagnification}
      icon={null}
      announceUpdatesForAccessibility
      aria-label="Magnification"
    />
  );
}

Props

The full prop type is ZoomIndicatorProps, which extends HTMLAttributes<HTMLDivElement>.
PropTypeDefaultDescription
value
number
—
Required. Current level. Clamped to the range before it is drawn and reported.
minimumValue
number
0
Low end of the range, reported as aria-valuemin.
maximumValue
number
1
High end of the range, reported as aria-valuemax.
icon
IconSource \| null
circle-handle glyph
Icon shown at the bottom. Pass null to drop the icon area; the gap below the bar closes with it. undefined keeps the default glyph, so a conditional expression can fall back to it.
animated
boolean
false
Tween value changes instead of snapping. Applies to every change while set.
announceUpdatesForAccessibility
boolean
false
Publish the rounded percentage into a polite live region so screen readers narrate each change.
aria-label
string
—
Appended after the percentage in the accessible name. Blank or whitespace-only labels are ignored.
aria-labelledby
string
—
Id of external label text, applied to the progressbar element. It replaces the generated name outright, so the percentage is no longer part of it.
aria-describedby
string
—
Id of additional description text, applied to the progressbar element.
className
string
''
Added to the root element.
style
CSSProperties
{}
Merged onto the root element.
The ref is forwarded to the root element. Any aria-* attribute you pass is applied to the inner progressbar element, where it can take effect; every other DOM prop, including data-*, lands on the root. The component writes role, aria-valuenow, aria-valuemin, and aria-valuemax on that inner element last, so values you pass for those four are overwritten.

Behavior

  • Range and clamping. The value is clamped to [minimumValue, maximumValue], so an out-of-range reading never overdraws the bar. Set the range to the real zoom range rather than normalizing it yourself: the component reports your raw value through aria-valuenow and derives the percentage for the label, so a range that starts at the minimum magnification stays truthful. When the minimum and maximum are equal it reports 100%.
  • Layout. A vertical pill of fixed width: the bar on top, the icon beneath it. The bar has a minimum height, so the pill has an intrinsic minimum size; icon={null} removes the icon area and the gap that separated it from the bar, while the pill’s vertical padding stays the same.
  • Bar appearance. The bar is vertical, fills from the bottom up, and always renders in its active, expanded appearance so the pill stays legible as a transient overlay on the additive-light display.
  • Materials and color. The pill is filled with --uit-color-background-elevation2 and fully rounded; the icon is tinted with --uit-color-icon-primary, and the bar’s filled portion uses --uit-color-control-active.
  • Icon.icon takes any IconSource: an inline vector, a caller asset referenced by URL, or a plain URL string. The component owns the icon’s size and tint.
  • Motion. With animated unset, value changes apply immediately, which is usually right for a value the user is actively changing. Setting it applies a sampled spring transition to the fill and keeps applying it to every later change while it stays set.
  • Reduced motion. The component does not read a motion preference for you. Call usePrefersReducedMotion and drop animated when the user has asked for less motion.
  • Not interactive. Nothing about the pill is interactive. It has no hover, press, or focus state and takes no part in directional navigation.

Accessibility

  • Renders an element with role="progressbar" carrying aria-valuenow (the clamped value, in your units), aria-valuemin, and aria-valuemax. The drawn bar inside it is hidden from assistive technology, so the component contributes exactly one progressbar to the accessibility tree.
  • Without aria-label the accessible name is just the rounded percentage, which says nothing about what is being scaled. Supply a label such as Camera zoom; it is appended after the percentage — 75%, Camera zoom. A label that is empty or only whitespace is ignored.
  • Live-region announcements are off by default. Turning announceUpdatesForAccessibility on publishes just the percentage into a polite, atomic live region that sits outside the progressbar element so the change is reliably picked up. Enable it only when the overlay is the sole feedback for the change.
  • The indicator contributes no tab stop, so it never intercepts directional navigation from the content it floats above.
  • Use aria-labelledby when the naming text already exists on screen, and aria-describedby for supplementary detail; both are forwarded to the progressbar element.
  • Drive the value from the camera or media view that actually owns the zoom.
  • Show the pill while the level moves and dismiss it shortly after it settles.
  • Always give it an aria-label, since it has no default one.
  • Pass the real magnification range, minimum included, so the reported value matches what the rest of your interface shows.

Avoid

  • Present it as feedback rather than a draggable control.
  • Avoid keeping it on screen as a permanent readout.
  • Use ZoomIndicator for the vertical pill instead of rotating or restyling a VolumeIndicator.
  • Avoid stretching it across the short axis; its width is fixed and only the height is meant to grow.