Skip to content
All components

Components

Motion

spring_f32 follows a target on a spring, tween_f32 eases to each new value, count_up counts a number up over the slow step, and Reveal opens and closes every menu, popover, dialog, toast and collapsible. Durations and curves come only from the tokens' motion ladder, and each animation asks for frames until it settles, so an idle window repaints nothing. The web face does not draw it yet.

No web face yet

Today the Mac draws it through ocean-ui-native; the web face does not draw it yet.

On the Mac

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

Motion drawn by Ocean UI's native face, darkMotion drawn by Ocean UI's native face, light

Use it

Native

use ocean_ui_native::{Reveal, RevealFrom, Show};
Reveal { open: d.reveal, from: RevealFrom::SlideUp(8.0) }.show(ui, Id::unique(("gallery.reveal", name)), |ui| {
    Badge { text: name.into(), tone: Tone::Info }.show(ui)
})

Cargo feature base of ocean-ui-native; available since 2026-10-29.

Props

NameTypeDefaultWhat
openbool—Whether the Reveal is open; it opens over the fast step and closes over the instant step.
fromRevealFrom—How a Reveal arrives: Fade, SlideUp(points), Scale(start) or Collapse.
spring_f32fn(&Ui, Id, f32, &Spring) -> f32—A value that follows its target on a spring, such as Spring::DEFAULT (170 / 26 / 1).
tween_f32fn(&Ui, Id, f32, Tween) -> f32—A value that eases to each new target over a Tween, never jumping mid-flight.
count_upfn(&Ui, Id, f64) -> f64—A number that counts up to its target over the slow step with a cubic ease-out.

Accessibility

  • Reduced motion follows OCEAN_UI_REDUCE_MOTION=1, else the macOS Reduce motion setting, read at most once a second.
  • Under reduced motion every duration is 0 and every spring snaps, so each value lands at once.
  • Every animation ends where the screen would be without it, so nothing depends on watching it move.
  • A fully closed Reveal draws nothing, so its content leaves the accessibility tree with 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