Skip to content
All components

Components

Delta

Delta shows how far a number moved: +6, −2 with a true minus sign, or ±0 when nothing changed. Its tone is worked out, not chosen; it is Ok when the change is good, Bad when it is bad and Neutral when there is none. Set fewer_is_better for errors, latency and cost, where going down is the good direction.

More is better

Up is good for revenue; the words are its label.

+12−8
Delta { by: 12, against: 100, fewer_is_better: false }.html(out);
Delta { by: -8, against: 100, fewer_is_better: false }.html(out);

Fewer is better

For errors and waiting, down is the good direction.

−14+5
Delta { by: -14, against: 60, fewer_is_better: true }.html(out);
Delta { by: 5, against: 60, fewer_is_better: true }.html(out);

No change

Plus or minus zero, neutral.

±0
Delta { by: 0, against: 42, fewer_is_better: false }

On the Mac

The same vocabulary drawn by Ocean UI's native face (egui on Metal), as the gallery's snapshot.

Delta drawn by Ocean UI's native face, darkDelta drawn by Ocean UI's native face, light

Use it

Web

use ocean_ui_core::Delta;
Delta { by: -2, against: 14, fewer_is_better: true }

Native

use ocean_ui_native::{Show, core::Delta};
Delta { by: 6, against: 24, fewer_is_better: false }.show(ui);

Cargo feature base of ocean-ui-core, ocean-ui-web and ocean-ui-native; available since 2026-10-29.

In App UI, the kpis block draws it from YAML.

Props

NameTypeDefaultWhat
byi64—The change; positive is up and negative is down.
againsti64—The base the change is measured against; percent() is None when it is 0.
fewer_is_betterbool—Down is the good direction, as for errors and latency.

Accessibility

  • The delta is role="img" with words in its aria-label, such as "6 more than 24" or "2 fewer than 14".
  • The same words show on hover through the title attribute.
  • Its colour follows the direction and fewer_is_better, and the words carry the meaning without it.

Related

Markdown

The same page as Markdown, for an agent or a pull request.

Search

esc

Components

Blocks

Screens built from blocks

The Ocean app

Ocean Base console