2026-07-15 15:33:44 +02:00
# Animations
Refactor animation and keyframe handling in JSX and runtime
- Removed `PATCH_PROP_KEYS` and `PatchProps`, streamlining property management as the document structure no longer requires patching by prop name.
- Updated type definitions to introduce new internal prop groups (`IdentityProps`, `PositionProps`, `OffsetProps`, `SizeProps`, `TransformProps`, `TimingProps`, `SequenceItemProps`), enhancing clarity and organization of properties.
- Refactored animation and keyframe structures to utilize `<animation>` and `<keyframeTrack>` elements, ensuring consistent handling of animatable properties.
- Updated migration documentation to reflect the removal of obsolete structures and the introduction of new prop groups, detailing their usage in the context of animations and keyframes.
2026-08-18 18:50:18 +02:00
`<animation>` declares one **preset in/out animation** on the clip holding it: it plays over the clip's head (`"in"` ) or tail (`"out"` ), between the node's static state and the preset's start/end state. For hand-authored motion on individual props, use [keyframes ](./keyframes.md ); the two compose on distinct properties.
2026-07-15 15:33:44 +02:00
```tsx
2026-08-25 14:32:48 +02:00
< video src = "b-roll/intro.mp4" width = {1920} height = {1080} start = {0} end = {8} >
Refactor animation and keyframe handling in JSX and runtime
- Removed `PATCH_PROP_KEYS` and `PatchProps`, streamlining property management as the document structure no longer requires patching by prop name.
- Updated type definitions to introduce new internal prop groups (`IdentityProps`, `PositionProps`, `OffsetProps`, `SizeProps`, `TransformProps`, `TimingProps`, `SequenceItemProps`), enhancing clarity and organization of properties.
- Refactored animation and keyframe structures to utilize `<animation>` and `<keyframeTrack>` elements, ensuring consistent handling of animatable properties.
- Updated migration documentation to reflect the removal of obsolete structures and the introduction of new prop groups, detailing their usage in the context of animations and keyframes.
2026-08-18 18:50:18 +02:00
< animation type = "fade" duration = "15f" / >
< animation type = "slideUp" phase = "out" duration = {0.5} delay = {0.2} / >
< / video >
2026-07-15 15:33:44 +02:00
```
Refactor animation and keyframe handling in JSX and runtime
- Removed `PATCH_PROP_KEYS` and `PatchProps`, streamlining property management as the document structure no longer requires patching by prop name.
- Updated type definitions to introduce new internal prop groups (`IdentityProps`, `PositionProps`, `OffsetProps`, `SizeProps`, `TransformProps`, `TimingProps`, `SequenceItemProps`), enhancing clarity and organization of properties.
- Refactored animation and keyframe structures to utilize `<animation>` and `<keyframeTrack>` elements, ensuring consistent handling of animatable properties.
- Updated migration documentation to reflect the removal of obsolete structures and the introduction of new prop groups, detailing their usage in the context of animations and keyframes.
2026-08-18 18:50:18 +02:00
| Prop | Type | Default | Meaning |
| ---- | ---- | ------- | ------- |
| `type` | `AnimationType` (**required**) | | Preset, see below. |
| `phase` | `"in" \| "out"` | `"in"` | Plays from the clip's head or into its tail. |
| `duration` | `Time` | 1 second | Length of the animation. |
| `delay` | `Time` | `0` | Gap between the clip edge and the animation: after the head for `"in"` , before the tail for `"out"` . |
2026-08-25 14:32:48 +02:00
Valid under any node (`<rect>` , `<text>` , `<video>` , `<image>` , `<audio>` , `<group>` , `<captions>` , `<adjustmentLayer>` ). An `<animation>` is an element like any other: it has an `id` , the editor writes changes back to it, and it is copied with its node.
2026-07-15 15:33:44 +02:00
## Types
The editor's animations inspector options:
| `type` | Effect |
| ------ | ------ |
2026-09-29 22:21:23 +02:00
| `"fade"` | Opacity ramp between 0 and the node's opacity. |
2026-07-15 15:33:44 +02:00
| `"slideLeft"` , `"slideRight"` , `"slideUp"` , `"slideDown"` | Slide in from (or out toward) the named direction, fading. |
2026-09-29 22:21:23 +02:00
| `"grow"` | Scales up from 50% of the node's scale. |
| `"shrink"` | Scales down from 150% of the node's scale. |
2026-07-15 15:33:44 +02:00
| `"spin"` | Scale plus rotation. |
| `"twist"` | Overscale plus rotation and offset. |
2026-09-29 22:21:23 +02:00
| `"blur"` | 24px blur ramp on top of the node's blur. |
2026-07-15 15:33:44 +02:00
| `"appearWord"` | Text only: reveals the text word by word. |
| `"appearChar"` | Text only: reveals the text character by character. |
| `"scramble"` | Text only: resolves scrambled characters into the text. |
| `"gain"` | Audio only: volume ramp (fade-in/fade-out of the mix). No visual effect. |
Refactor animation and keyframe handling in JSX and runtime
- Removed `PATCH_PROP_KEYS` and `PatchProps`, streamlining property management as the document structure no longer requires patching by prop name.
- Updated type definitions to introduce new internal prop groups (`IdentityProps`, `PositionProps`, `OffsetProps`, `SizeProps`, `TransformProps`, `TimingProps`, `SequenceItemProps`), enhancing clarity and organization of properties.
- Refactored animation and keyframe structures to utilize `<animation>` and `<keyframeTrack>` elements, ensuring consistent handling of animatable properties.
- Updated migration documentation to reflect the removal of obsolete structures and the introduction of new prop groups, detailing their usage in the context of animations and keyframes.
2026-08-18 18:50:18 +02:00
Text types apply only to [`<text>` ](./text.md ) and [`<captions>` ](./captions.md ).
2026-07-15 15:33:44 +02:00
## Semantics
- `duration` and `delay` take any [time format ](./timing.md#time-formats ). An `"in"` animation plays over `[delay, delay + duration]` from the clip's in point; an `"out"` animation ends `delay` before the clip's out point. Both track the clip when it is retimed.
2026-09-29 22:21:23 +02:00
- Presets are **relative to the node's authored props** : they scale or shift them rather than replace them. A `"fade"` on a clip with `opacity={0.8}` ramps between 0 and 0.8, `"grow"` on a clip with `scale={2}` grows from 1 to 2, and slides move from the authored `offsetX` /`offsetY` .
- A node takes **any number of animations** ; overlapping ones compound on the properties they share (a `"fade"` and a `"slideUp"` running together multiply their opacity ramps). The text types are the exception: they replace the displayed text, so the later one in document order wins. A [keyframe track ](./keyframes.md ) on the same property (say, a keyframed `opacity` next to `"fade"` ) overrides the preset while it has keyframes; presets and keyframes on distinct properties compose freely.