editor/reference/jsx/elements.md
konstantin-paulus 3e8602d407 Add adjustment layer support to JSX and reconciler
- Introduced `<adjustmentLayer>` element to the JSX framework, allowing for transformations on the clip below it without drawing its own content.
- Updated type definitions to include `AdjustmentLayerProps` for better type safety and documentation.
- Enhanced the reconciler to handle the new adjustment layer entity, ensuring proper integration within the document structure.
- Added comprehensive documentation for the adjustment layer, detailing its functionality and usage examples.
- Improved overall code organization and readability across affected components, setting the stage for future enhancements.
2026-08-20 15:42:20 +02:00

4.8 KiB
Raw Blame History

Element reference

camelCase composition elements map 1:1 onto internal node types. Lowercase DOM vocabulary is valid only inside <html> content.

Element Internal node Notes
<group> Container 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. With mask it clips its parent instead of drawing.
<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.
<textRange> Text range sub-entity Style override over a run of the parent <text>'s glyphs, by character index.
<sequence> Sequential group Track container for back-to-back clips; positions are explicit.
<captions> Caption node Transcribes the enclosing scene's audio.
<adjustmentLayer> Adjustment layer Draws nothing; its transform composes onto the clip directly below it, for as long as its own clip lasts.
<solidPaint> Solid paint Paint child.
<linearGradientPaint> / <radialGradientPaint> Gradient paint Paint child; takes <colorStop> children.
<colorStop> Gradient color stop Valid only inside gradient paints.
<html> Geometry with Html paint Children are real, reactive HTML drawn into the box by the browser (html-in-canvas, flagged Chromium API). <htmlPaint> is the paint child form.
<surface> Geometry with Surface paint ref hands you a canvas to draw with any context type (2d, webgl, webgpu); sampled every frame. <surfacePaint> is the paint child form.

A <rect> becomes a scene (the composition root) when given a scene identity: it then clips its children to width×height and is valid only at the document top level. See scene.md.

User-defined components are ordinary Solid components; they compose the elements above and carry no runtime cost. Only the elements above 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 (default "cover"), 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 A within-render label so another node can reference this one (e.g. syncTo);
scene string none Promotes a <rect> to a scene, the only mountable root, and is its identity across mounts (see scene.md).
name string none Human-readable node name.
x, y number 0 Position relative to the parent, px.
offsetX, offsetY number 0 Render-time translation on top of x/y, px; moves the drawn content without changing the layout box. Subpixel values are kept.
width, height number parent size Box size, px.
rotation number 0 Rotation in degrees.
opacity number 1 0-1.
cornerRadius number 0 Uniform corner radius, px.
cornerRadiusTopLeft, cornerRadiusTopRight, cornerRadiusBottomRight, cornerRadiusBottomLeft number cornerRadius Per-corner radius, px; a corner without one takes cornerRadius, so cornerRadius={20} cornerRadiusTopLeft={0} rounds three corners.
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).

Numeric props are animated by <keyframeTrack> children (see keyframes.md); preset in/out effects are <animation> children (see animations.md).