Skip to main content

setTimelineDuration

Sets the duration, in seconds, for the timeline with the given id.

Signature​

setTimelineDuration(id: string, duration: number): void

Parameters​

id​

A timeline id read from timelines.

duration​

The new timeline duration in seconds. Must be greater than zero.

Remarks​

const node = figma.currentPage.selection[0]
const [timeline] = node?.timelines ?? []
if (node && timeline) {
node.setTimelineDuration(timeline.id, 1.2)
}