effect-motion
API Referenceeffect-motionNamespacesMotionType aliases

Target

type Target<Tag> =

Type Alias: Target<Tag>

type Target<Tag> =
  | Partial<InterpolableOrInterpolator<EntityByTag<Tag>>>
  | ((data) => Partial<InterpolableOrInterpolator<EntityByTag<Tag>>>);

Defined in: packages/motion/src/Motion.ts:159

What tween / tweenTo accept as an endpoint: the fields to animate and their values.

Type Parameters

Type ParameterDescription
Tag extends EntityTagThe entity tag, which determines the available fields.

Remarks

Two forms. A plain object states targets literally. A function receives the entity's data at animation start and computes them, which is how you express a target relative to where the entity already is (data.radius * 2) without reading it out in a separate step.

Only numeric and Color fields of the entity are addressable — those are the ones that can be interpolated.

On this page