effect-motion
API Referenceeffect-motionNamespacesEntityVariables

Rect

const Rect: TaggedStruct<"Rect", {

Variable: Rect

const Rect: TaggedStruct<"Rect", {
  cornerRadius: withConstructorDefault<Number>;
  fillColor: withConstructorDefault<typeof Color>;
  height: withConstructorDefault<Number>;
  opacity: withConstructorDefault<Number>;
  position: withConstructorDefault<TaggedStruct<"Vec3", {
     x: withConstructorDefault<Number>;
     y: withConstructorDefault<Number>;
     z: withConstructorDefault<Number>;
  }>>;
  rotation: withConstructorDefault<TaggedStruct<"Vec3", {
     x: withConstructorDefault<Number>;
     y: withConstructorDefault<Number>;
     z: withConstructorDefault<Number>;
  }>>;
  scale: withConstructorDefault<TaggedStruct<"Vec3", {
     x: withConstructorDefault<Number>;
     y: withConstructorDefault<Number>;
     z: withConstructorDefault<Number>;
  }>>;
  strokeColor: optionalKey<typeof Color>;
  strokeWidth: withConstructorDefault<Number>;
  visible: withConstructorDefault<Boolean>;
  width: withConstructorDefault<Number>;
}>;

Defined in: packages/motion/src/Entity.ts:179

The canonical 2.5D plane. All-zero rotation is a camera-facing billboard; non-zero tilts it as a real plane in 3D.

cornerRadius rounds all four corners in local units. It defaults to 0 and can be animated with Motion.tween/tweenTo. Rendering clamps it to [0, min(abs(width), abs(height))/2]: negative values stay sharp and overshoots become pills (circles for equal dimensions). Authored values remain unchanged; signed dimensions reflect the contour as before.

On this page