Motion.scaleIn
luastra/motionMotion.scaleIn(options: any?): MotionMap
Returns a MotionMap that grows a component from a smaller scale to its final size without changing the space reserved by layout. Optional values tune the starting scale, duration, and easing within admitted bounds.
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
The function returns immutable motion data synchronously. Assign a preset MotionMap directly, or place Tween/Sequence values under supported motion channel names; the host animates without rerunning app.render on every frame.
When to use it
Use Motion.scaleIn for a newly created card, badge, or focused object when gentle emphasis helps orientation. Avoid scaling dense text or controls so often that reading and targeting become unstable.
Parameters
| Parameter | Type / values | Description |
|---|---|---|
| options | any? | Optional starting scale, duration, and easing overrides. |
| options.from | number (0..100)? | Optional initial scale; defaults to 0.92 and ends at 1. |
| options.durationMs | number (0..60000)? | Optional scale duration; defaults to 220 ms. |
| options.easing | "linear" | "easeOutCubic" | "easeInOutCubic"? | Optional interpolation curve; defaults to "easeOutCubic". |
Returns
MotionMap — a complete property-to-motion map that can be assigned directly to a supported component motion field.
What happens next
A descriptor or MotionMap ready to attach to a supported UI node.
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.
Focused example
local Motion = require("luastra/motion")
local motion = Motion.scaleIn { from = 0.92, durationMs = 220 }