Skip to content

API Reference / @gtkx/animated / SpringProps

Interface: SpringProps<T> ​

Use the SpringUpdate type if you need the to prop to exist. For function types, prefer one overload per possible to prop type (for better type inference).

The T parameter can be a set of animated values (as an object type) or a primitive type for a single animated value.

Extends ​

Type Parameters ​

T ​

T = any

Properties ​

cancel? ​

optional cancel?: MatchProp<T>

Cancel all animations by using true, or some animations by using a key or an array of keys.

Inherited from ​

AnimationProps.cancel


config? ​

optional config?: Partial<AnimationConfig> | ((key) => SpringConfig)

Configure the spring behavior for each key.

Inherited from ​

AnimationProps.config


default? ​

optional default?: boolean | SpringProps<T>

Override the default props with this update.

Inherited from ​

AnimationProps.default


delay? ​

optional delay?: number | ((key) => number)

Milliseconds to wait before applying the other props.

Inherited from ​

AnimationProps.delay


from? ​

optional from?: GoalValue<T>


immediate? ​

optional immediate?: MatchProp<T>

When true, props jump to their goal values instead of animating.

Inherited from ​

AnimationProps.immediate


loop? ​

optional loop?: LoopProp<SpringUpdate<any>>


onChange? ​

optional onChange?: EventProp<OnChange<SpringValue<T>, SpringValue<T>, undefined>>

Called when a spring has its value changed.


onPause? ​

optional onPause?: EventProp<OnPause<SpringValue<T>, SpringValue<T>, undefined>>


onProps? ​

optional onProps?: EventProp<OnProps<T>>

Called after an animation is updated by new props, even if the animation remains idle.


onRest? ​

optional onRest?: EventProp<OnRest<SpringValue<T>, SpringValue<T>, undefined>>

Called when all animations come to a stand-still.


onResume? ​

optional onResume?: EventProp<OnResume<SpringValue<T>, SpringValue<T>, undefined>>


onStart? ​

optional onStart?: EventProp<OnStart<SpringValue<T>, SpringValue<T>, undefined>>

Called when an animation moves for the first time.


pause? ​

optional pause?: MatchProp<T>

Pause all animations by using true, or some animations by using a key or an array of keys.

Inherited from ​

AnimationProps.pause


reset? ​

optional reset?: MatchProp<T>

Start the next animations at their values in the from prop.

Inherited from ​

AnimationProps.reset


reverse? ​

optional reverse?: boolean

Swap the to and from props.

Inherited from ​

AnimationProps.reverse