• Overview
@angular/animations

state

function
deprecatedsince v20.2

Declares an animation state within a trigger attached to an element.

Deprecation warning

Use animate.enter or animate.leave instead. Intent to remove in v23

API

function state(  name: string,  styles: AnimationStyleMetadata,  options?: { params: { [name: string]: any } } | undefined,): AnimationStateMetadata;

Usage Notes

Use the trigger() function to register states to an animation trigger. Use the transition() function to animate between states. When a state is active within a component, its associated styles persist on the element, even when the animation ends.

Jump to details