← Declarative motion

Motion.TweenOptions

luastra/motion

Motion.TweenOptions is the checked configuration record accepted by the related SDK operation. Required fields establish the minimum contract, while optional fields preserve documented defaults when omitted.

Before you use it

Add luastra/motion to this module's dependencies in luastra.json, then import it with require("luastra/motion"). Motion itself needs no capability; a visible result requires ui.render and a component that accepts the returned descriptor through its motion field.

How it fits

Motion types describe immutable timing data and are erased after analysis.

When to use it

Use Motion.TweenOptions when a reusable variable or helper passes configuration to the related SDK operation. The exported type keeps optional and required fields aligned with the checked public contract.

Fields or definition

ParameterType / valuesDescription
fromnumberNumeric channel value at the beginning of the transition.
tonumberNumeric channel value at the end of the transition.
durationMsnumberDuration of this motion or delay in milliseconds.
easingEasing?Named interpolation curve used between the start and end values.

What happens next

A checked descriptor, sequence, channel map, or easing value.

Failures and fixes

Unknown options, invalid bounds, or unsupported channels fail validation. Motion must not drive application logic; use Timer for state changes, and rely on the host to present the final state when reduced motion is enabled.

Availability

Public-source alpha API in 0.5.0-alpha; presentation follows host and reduced-motion policy.

Exact declaration

export type TweenOptions = {
    from: number,
    to: number,
    durationMs: number,
    easing: Easing?,
}

Complete inventory

View all pages in Declarative motion
← Previous: Motion.EasingNext: Motion.Tween →