W3cubDocs

/Angular

state

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.

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/animations/state