---
title: "transition.morphRect: Morph Rect Transition — Motion kit command — Kition"
description: "Container-transform carry: the `from` layer's on-screen rectangle (with its corner radius) morphs into the `to` layer's rectangle over `frames` (18, smooth): both layers get a rounded-rectangle mask that follows the container and a cover scale and position keyed every frame, so the outgoing content scales and crops into the incoming one, which fades in inside the container over the last third. One undo step."
canonical: "https://developer.kition.ai/docs/kits/motion/commands/transition.morphRect"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/motion/commands/transition.morphRect](https://developer.kition.ai/docs/kits/motion/commands/transition.morphRect)

# transition.morphRect

**Morph Rect Transition.** Container-transform carry: the `from` layer's on-screen rectangle (with its corner radius) morphs into the `to` layer's rectangle over `frames` (18, smooth): both layers get a rounded-rectangle mask that follows the container and a cover scale and position keyed every frame, so the outgoing content scales and crops into the incoming one, which fades in inside the container over the last third. One undo step.

- Kit: Motion 0.1.0 (.kmotion); reference: [Motion kit commands](https://developer.kition.ai/docs/kits/motion.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `comp` | `integer \| string` | no |  |
| `ease` | `string \| number[]` | no | a curve name (snappy, out, smooth, swift, settle, pop, reseat, fly, linear) or [x1, y1, x2, y2] |
| `frames` | `number` | no | default 18 |
| `from` | `integer \| string` | no | the outgoing layer (its on-screen rectangle at start) |
| `motionBlur` | `boolean` | no | default true |
| `radius` | `number \| number[]` | no | corner radius px: a number or [from, to] |
| `start` | `number` | no | seconds; comp time; default the current time |
| `to` | `integer \| string` | no | the incoming layer (its rectangle at the end) |

## Call through motion_run

```text
motion_run {
  "path": "<file>.kmotion",
  "steps": [{ "command": "transition.morphRect" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `comp`, `ease`, `frames`, `from`, `motionBlur`, `radius`, `start`, `to`. motion_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "comp": {
      "oneOf": [
        {
          "description": "item id",
          "type": "integer"
        },
        {
          "description": "comp name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Item"
      ]
    },
    "ease": {
      "description": "a curve name (snappy, out, smooth, swift, settle, pop, reseat, fly, linear) or [x1, y1, x2, y2]",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "frames": {
      "description": "default 18",
      "type": "number"
    },
    "from": {
      "description": "the outgoing layer (its on-screen rectangle at start)",
      "oneOf": [
        {
          "description": "layer id or 1-based index",
          "type": "integer"
        },
        {
          "description": "layer name or #n",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "motionBlur": {
      "description": "default true",
      "type": "boolean"
    },
    "radius": {
      "description": "corner radius px: a number or [from, to]",
      "oneOf": [
        {
          "type": "number"
        },
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "start": {
      "description": "seconds; comp time; default the current time",
      "type": "number"
    },
    "to": {
      "description": "the incoming layer (its rectangle at the end)",
      "oneOf": [
        {
          "description": "layer id or 1-based index",
          "type": "integer"
        },
        {
          "description": "layer name or #n",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/motion-darwin-arm64@0.1.0 and the kit itself (motion_commands through @kition/cli@0.1.1, built from KitionAI/kition-motion@4719aa7).
