@gtkx/react / AdwSpringAnimationProps
Type Alias: AdwSpringAnimationProps
AdwSpringAnimationProps =
AnimationBaseProps&object
Defined in: packages/react/src/jsx.ts:102
Props for a spring (physics-based) animation using Adw.SpringAnimation.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
clamp? | boolean | Whether to clamp the animation value to prevent overshooting | packages/react/src/jsx.ts:112 |
damping? | number | Damping ratio controlling oscillation decay (default: 1, critically damped) | packages/react/src/jsx.ts:104 |
delay? | number | Delay before starting the animation in milliseconds | packages/react/src/jsx.ts:114 |
initialVelocity? | number | Initial velocity to apply at animation start | packages/react/src/jsx.ts:110 |
mass? | number | Virtual mass in kg affecting momentum (default: 1) | packages/react/src/jsx.ts:108 |
stiffness? | number | Spring stiffness in N/m affecting animation speed (default: 100) | packages/react/src/jsx.ts:106 |
Example
tsx
<AdwSpringAnimation
initial={{ scale: 0.9, opacity: 0 }}
animate={{ scale: 1, opacity: 1 }}
damping={0.8}
stiffness={200}
animateOnMount
>
<GtkButton label="Spring in" />
</AdwSpringAnimation>