Skip to main content

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 ParameterDefault typeDescription
M extends AnimationModeAnimationModeThe animation mode, either "timed" or "spring"

Properties

animate?

optional animate: AnimatableProperties

Defined in: animation/types.ts:113

Target property values to animate towards


animateOnMount?

optional animateOnMount: boolean

Defined in: animation/types.ts:119

Whether to animate from initial to animate when first mounted (default: false)


children?

optional children: ReactNode

Defined in: animation/types.ts:125

The child widget to animate (must be a single GTK widget)


exit?

optional exit: AnimatableProperties

Defined in: animation/types.ts:115

Property values to animate to when the component unmounts


initial?

optional initial: 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()?

optional onAnimationComplete: () => void

Defined in: animation/types.ts:123

Callback fired when an animation completes

Returns

void


onAnimationStart()?

optional onAnimationStart: () => void

Defined in: animation/types.ts:121

Callback fired when an animation begins

Returns

void


transition?

optional transition: M extends "timed" ? TimedTransition : SpringTransition

Defined in: animation/types.ts:117

Transition configuration (type depends on mode)