Interface for an animation player. Provides a simple API to control animations and customize icon properties dynamically.

Hierarchy

  • IPlayer

Implemented by

Properties

colors: null | IColors

This property allows you to discover customizable colors or update them within a processed icon.

Example (list all supported colors by the icon):

{ ...iconElement.playerInstance.colors }

Example (update a single color):

iconElement.playerInstance.colors.primary = '#ff0000';

Example (update multiple colors at once):

iconElement.playerInstance.colors = { primary: 'red', secondary: 'blue' };

Example (reset all colors to default):

iconElement.playerInstance.colors = null;

The 'direction' property lets you influence the direction of the animation playback, whether it plays forward (1) or in reverse (-1).

duration: number

The 'duration' property provides the value of the animation length in seconds.

frame: number

Access the player frame. You can manually control the animation playback by changing this frame.

frames: number

The 'frames' property provides the value of the animation length in terms of the number of frames.

isPlaying: boolean

The player is currently playing the animation.

isReady: boolean

The player is ready.

loop: boolean

This property allows you to control whether the player should loop the animation.

properties: IProperties

Access to read or modify multiple properties at once. Resets to default any properties that are not provided.

Param

Properties to assign.

speed: number

This property allows you to control the speed of the icon animation.

state: null | string

This property allows you to control the state (motion type) of the icon. States enable switching between multiple animations built into a single icon file.

states: IState[]

The 'states' property provides a list of supported states by a processed icon.

stroke: null | Stroke

The 'stroke' property gives you the value of the icon's stroke width.

Methods