state
function
deprecatedsince v20.2
Declares an animation state within a trigger attached to an element.
Deprecation warning
API
function state( name: string, styles: AnimationStyleMetadata, options?: { params: { [name: string]: any } } | undefined,): AnimationStateMetadata;state
Declares an animation state within a trigger attached to an element.
@paramname
stringOne or more names for the defined state in a comma-separated string. The following reserved state names can be supplied to define a style for specific use cases:
voidYou can associate styles with this name to be used when the element is detached from the application. For example, when anngIfevaluates to false, the state of the associated element is void.*(asterisk) Indicates the default state. You can associate styles with this name to be used as the fallback when the state that is being animated is not declared within the trigger.
@paramstyles
AnimationStyleMetadataA set of CSS styles associated with this state, created using the
style() function.
This set of styles persists on the element once the state has been reached.
@paramoptions
{ params: { [name: string]: any; }; } | undefinedParameters that can be passed to the state when it is invoked. 0 or more key-value pairs.
@returns
AnimationStateMetadataUsage notes
Use the