Skip to main content

Module spring

Module spring 

Source
Expand description

Ported from Arc (MIT) © 2026 Elia Kuratli Spring adapter over gpui_kit::SpringConfig / gpui_kit::base::motion matching motion-dom/dist/es/animation/generators/spring.mjs frame-by-frame (< 0.5px error).

Structs§

SpringChannelState
Persistent state for a keyed arc_spring channel.
SpringOptions
Options for arc_spring_with_options.
SpringSample
Sample returned by SpringSolver::sample and arc_spring_with_options.
SpringSolver
Analytical spring solver ported directly from Motion’s spring.mjs.

Functions§

arc_measured_spring
测量驱动的布局弹簧:未知尺寸只占位,首次真实测量直接落位,后续变化保留弹簧。 不给估算尺寸建立通道,避免组件挂载时把排版校正误播成入场动效。
arc_spring
Keyed spring hook respecting Arc SpringSpec, MotionClock (0.25x slow-mo), cx.reduce_motion(), and gpui::SpringConfig velocity preservation.
arc_spring_with_options
Full-featured keyed spring hook returning position, velocity, and settled flag.
arc_transition
Keyed duration + cubic-bezier transition that honors MotionClock (0.25x slow-mo) and cx.reduce_motion().