Type Alias: AnimationProps<M>
AnimationProps<
M> =object
Defined in: animation/types.ts:107
Props for the Animation component.
Provides a declarative API for animating widget properties using either timed (duration-based) or spring (physics-based) animations.
Example
<x.Animation
mode="spring"
initial={{ opacity: 0, translateY: -20 }}
animate={{ opacity: 1, translateY: 0 }}
exit={{ opacity: 0, translateY: 20 }}
animateOnMount
>
<GtkLabel label="Animated content" />
</x.Animation>
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
M extends AnimationMode | AnimationMode | The animation mode, either "timed" or "spring" |
Properties
animate?
optionalanimate:AnimatableProperties
Defined in: animation/types.ts:113
Target property values to animate towards
animateOnMount?
optionalanimateOnMount:boolean
Defined in: animation/types.ts:119
Whether to animate from initial to animate when first mounted (default: false)
children?
optionalchildren:ReactNode
Defined in: animation/types.ts:125
The child widget to animate (must be a single GTK widget)
exit?
optionalexit:AnimatableProperties
Defined in: animation/types.ts:115
Property values to animate to when the component unmounts
initial?
optionalinitial:AnimatableProperties|false
Defined in: animation/types.ts:111
Initial property values before animation starts, or false to skip initial state
mode
mode:
M
Defined in: animation/types.ts:109
Animation type: "timed" for duration-based or "spring" for physics-based
onAnimationComplete()?
optionalonAnimationComplete: () =>void
Defined in: animation/types.ts:123
Callback fired when an animation completes
Returns
void
onAnimationStart()?
optionalonAnimationStart: () =>void
Defined in: animation/types.ts:121
Callback fired when an animation begins
Returns
void
transition?
optionaltransition:Mextends"timed"?TimedTransition:SpringTransition
Defined in: animation/types.ts:117
Transition configuration (type depends on mode)