editor/apps/cli/reference/jsx/elements.md
konstantin-paulus 5a8b56d29b Add animations prop to various components and documentation
Introduce the `animations` prop across multiple components, including audio, elements, and text, allowing for preset in/out animations. Update related documentation to reflect this new feature and enhance the `animations` handling in the node patching process. This change improves the flexibility and visual dynamics of the UI elements.
2026-07-15 15:33:44 +02:00

3.6 KiB
Raw Blame History

Element reference

Lowercase intrinsic elements map 1:1 onto internal node types:

Element Internal node Notes
<scene> Geometry with Scene tag Clips its children to width×height. Document root only.
<group> Geometry with Group tag Container with a transform; auto-fits its size from its children. Takes no fill or explicit size.
<rect> Geometry with Solid paint A filled rectangle; takes only paint children.
<video> Geometry with Video paint src resolves to a video asset.
<image> Geometry with Image paint src resolves to an image asset.
<audio> Geometry with Audio component and a hidden Waveform paint No visual output; carries volume.
<text> Geometry with Text component Children become editable glyphs.
<sequence> Sequential group Track container for back-to-back clips; positions are explicit.
<captions> Caption node Transcribes the enclosing scene's audio.
<solidPaint> Solid paint Paint child.
<linearGradientPaint> / <radialGradientPaint> Gradient paint Paint child; takes <colorStop> children.
<colorStop> Gradient color stop Valid only inside gradient paints.

User-defined components are ordinary Solid components; they compose intrinsics and carry no runtime cost. Only intrinsic elements produce entities.

Coordinates and sizing

  • Coordinates are pixels relative to the parent's box, origin top-left. No percentages, no layout keywords; explicit numbers until the layout engine lands.
  • Every element's box defaults to its parent's box: x and y default to 0, width and height default to the parent's size (the JSX analog of position: absolute; inset: 0). The scene's box is its required width×height.
  • How media pixels map into the box is controlled by objectFit, never by the box itself. A generated asset's placeholder therefore always has a definite size, even before the asset exists.

Common props

All visual elements accept:

Prop Type Default Meaning
key string none Stable identity across mounts; required on document roots (see roots.md).
name string none Human-readable node name.
x, y Animatable<number> 0 Position relative to the parent, px.
width, height Animatable<number> parent size Box size, px.
rotation Animatable<number> 0 Rotation in degrees.
opacity Animatable<number> 1 0-1.
cornerRadius Animatable<number> 0 Uniform corner radius, px.
start, end, sourceIn, sourceOut Time see timing.md Temporal placement.
transition TransitionSpec | null none Transition into the next clip; direct children of <sequence> only (see transitions.md).
animations AnimationSpec[] none Preset in/out animations over the clip's head and tail (see animations.md).

Animatable props also take a keyframe list; see keyframes.md.

One property table

Common and per-element props share a single property table, exported as PatchProps from @diffusionstudio/jsx. dapi node patch accepts exactly these keys, with the same value requirements, as patch entries on existing nodes; JSX and CLI cannot drift.