Property transitions let Paper interpolate a style property from its old value to a new one whenever that value changes — without any explicit animation state in your code. You declare what should animate and how long it should take; Paper handles the rest automatically across frames.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Paper/llms.txt
Use this file to discover all available pages before exploring further.
The .Transition() method
.Transition() on an element to register a transition for one property. When the value of property changes between frames, Paper plays a smooth interpolation over duration seconds.
Transitions are re-registered each frame — just like all other style calls. Place them in the base style chain (not inside a
.Hovered or .If() block) so they fire in both directions: entering and leaving the hover state.How transitions interact with state styles
The most common pattern is to set one value as the base and a different value inside a state block. Paper detects the change each frame and interpolates automatically:Transition declaration covers both directions.
Multiple transitions on one element
Register a separate.Transition() call for each property you want to animate:
TransitionConfig
Internally Paper stores transition settings in aTransitionConfig object:
TransitionConfig directly — .Transition() builds it for you — but it is useful to understand when reading source code or building style templates:
Which properties support transitions
Any property whose type can be linearly interpolated supports transitions. This covers all numeric properties, colours, vectors, gradients, box shadows, and transform properties:Visual
BackgroundColor, BorderColor, BorderWidth, Rounded, BoxShadow, BackdropBlur, BackgroundGradientTransform
TranslateX, TranslateY, ScaleX, ScaleY, Rotate, SkewX, SkewY, OriginX, OriginYLayout
Width, Height, Left, Right, Top, Bottom, PaddingLeft, PaddingRight, PaddingTop, PaddingBottomText
TextColor, FontSize, LetterSpacing, LineHeight, WordSpacingBackgroundImage) snap immediately to the new value regardless of a registered transition.
Built-in easing functions
All easing functions live in the staticEasing class and have the signature float Easing(float t) where t is the normalised 0..1 progress.
| Family | Functions |
|---|---|
| Linear | Linear |
| Quadratic | EaseIn, EaseOut, EaseInOut |
| Cubic | CubicIn, CubicOut, CubicInOut |
| Quartic | QuartIn, QuartOut, QuartInOut |
| Quintic | QuintIn, QuintOut, QuintInOut |
| Sinusoidal | SineIn, SineOut, SineInOut |
| Exponential | ExpoIn, ExpoOut, ExpoInOut |
| Circular | CircIn, CircOut, CircInOut |
| Back | BackIn, BackOut, BackInOut |
| Elastic | ElasticIn, ElasticOut, ElasticInOut |
| Bounce | BounceIn, BounceOut, BounceInOut |
| Utility | Step, SmoothStep, SmootherStep, Spring |
- Use Sine or Quad variants for subtle UI motion — they feel natural without being distracting.
- Use Expo or Circ for a crisp, snappy feel.
- Use Back when a slight overshoot adds character (menus sliding into view).
- Use Elastic sparingly — great for playful highlights, jarring in dense UIs.
- Use Bounce for game-style feedback (notifications dropping in).
Custom easing functions
AnyFunc<float, float> that maps [0, 1] → float is a valid easing. You can pass a lambda directly:
Easing.Spring function to tune oscillation and damping without needing AnimateSpring: