addAnimationEntryAsync
Adds a Figma animation to this custom animation style and resolves with the created entry. Throws if the style is remote, or if the animation cannot be added programmatically.
Signature
addAnimationEntryAsync(styleId: string, props?: { [key: string]: AnimationStylePropValue }): Promise<AnimationEntry>
Parameters
styleId
The styleId of the Figma animation style to add, from figmaAnimationStyles.
props
Optional property overrides for the new entry.
Remarks
const style = figma.createCustomAnimationStyle()
const [opacity] = figma.motion.figmaAnimationStyles()
if (opacity) {
const entry = await style.addAnimationEntryAsync(opacity.styleId)
console.log(entry.id, entry.name)
}