Perry supports animating widget properties for smooth transitions. Every
snippet below is excerpted from
docs/examples/ui/animation/snippets.ts —
CI compiles and runs it on every PR.
animateOpacity and animatePosition are special: they're documented as
methods on the widget handle (the only methods perry/ui exposes), and the HIR
lowers them to widgetAnimateOpacity / widgetAnimatePosition calls under the
hood.
{{#include ../../examples/ui/animation/snippets.ts:opacity}}{{#include ../../examples/ui/animation/snippets.ts:position}}When the first argument reads from a State.value, Perry auto-subscribes
the call to the state — toggling visible re-runs the animation.
{{#include ../../examples/ui/animation/fade_in.ts}}| Platform | Implementation |
|---|---|
| macOS | NSAnimationContext / ViewPropertyAnimator |
| iOS | UIView.animate |
| Android | ViewPropertyAnimator |
| Windows | WM_TIMER-based animation |
| Linux | CSS transitions (GTK4) |
| Web | CSS transitions |