Skip to content

🎥 Make videos programmatically with React

`remotion`: Add `Interactive.childrenSchema` for editable text children

Jonny Burger78da98452736
diff --git a/packages/brand/src/Compose/WhatIsRemotion.tsx b/packages/brand/src/Compose/WhatIsRemotion.tsx
index 5843c139ad..63669bd790 100644
--- a/packages/brand/src/Compose/WhatIsRemotion.tsx
+++ b/packages/brand/src/Compose/WhatIsRemotion.tsx
@@ -43,12 +43,7 @@ const labelSchema = {
...Interactive.backgroundSchema,
...Interactive.borderSchema,
...Interactive.borderRadiusSchema,
- children: {
- type: 'text-content',
- default: '',
- description: 'Text',
- keyframable: false,
- },
+ ...Interactive.childrenSchema,
} as const satisfies InteractivitySchema;
const LabelInner: React.FC<
diff --git a/packages/brand/src/announcements/whats-new-in-remotion/CodeBRoll.tsx b/packages/brand/src/announcements/whats-new-in-remotion/CodeBRoll.tsx
index fd0a206ead..64c7fa191a 100644
--- a/packages/brand/src/announcements/whats-new-in-remotion/CodeBRoll.tsx
+++ b/packages/brand/src/announcements/whats-new-in-remotion/CodeBRoll.tsx
@@ -105,14 +105,14 @@ const CodeBRollInner: React.FC<CodeBRollProps> = ({
};
const codeBRollSchema = {
- code: {type: 'text-content', default: '', description: 'Code'},
+ code: {type: 'string', default: '', description: 'Code'},
previousCode: {
- type: 'text-content',
+ type: 'string',
default: '',
description: 'Previous code',
},
- lang: {type: 'text-content', default: 'tsx', description: 'Language'},
- topExplainer: {type: 'text-content', default: '', description: 'Heading'},
+ lang: {type: 'string', default: 'tsx', description: 'Language'},
+ topExplainer: {type: 'string', default: '', description: 'Heading'},
} as const satisfies InteractivitySchema;
export const CodeBRoll = Interactive.withSchema({
diff --git a/packages/brand/src/announcements/whats-new-in-remotion/NumberedChapter.tsx b/packages/brand/src/announcements/whats-new-in-remotion/NumberedChapter.tsx
index 39f4ad39e4..a71b269a2a 100644
--- a/packages/brand/src/announcements/whats-new-in-remotion/NumberedChapter.tsx
+++ b/packages/brand/src/announcements/whats-new-in-remotion/NumberedChapter.tsx
@@ -136,7 +136,7 @@ const numberedChapterSchema = {
description: 'Chapter number',
},
chapterTitle: {
- type: 'text-content',
+ type: 'string',
default: '',
description: 'Chapter title',
},
diff --git a/packages/brand/src/announcements/whats-new-in-remotion/Prompt.tsx b/packages/brand/src/announcements/whats-new-in-remotion/Prompt.tsx
index fe3dcb4392..8e191cda6b 100644
--- a/packages/brand/src/announcements/whats-new-in-remotion/Prompt.tsx
+++ b/packages/brand/src/announcements/whats-new-in-remotion/Prompt.tsx
@@ -147,7 +147,7 @@ const PromptInner: React.FC<PromptProps> = ({prompt, thinkingIndex, style}) => {
};
const promptSchema = {
- prompt: {type: 'text-content', default: '', description: 'Prompt'},
+ prompt: {type: 'string', default: '', description: 'Prompt'},
thinkingIndex: {
type: 'number',
default: 0,
diff --git a/packages/core/src/AbsoluteFill.tsx b/packages/core/src/AbsoluteFill.tsx
index 281082528e..f1ed8753c4 100644
--- a/packages/core/src/AbsoluteFill.tsx
+++ b/packages/core/src/AbsoluteFill.tsx
@@ -16,7 +16,7 @@ import {
premountSchema,
borderRadiusSchema,
borderSchema,
- textContentSchema,
+ childrenSchema,
textSchema,
transformSchema,
type InteractivitySchema,
@@ -47,7 +47,7 @@ export const absoluteFillSchema = {
...borderSchema,
...borderRadiusSchema,
...textSchema,
- ...textContentSchema,
+ ...childrenSchema,
} as const satisfies InteractivitySchema;
const setRef = <ElementType,>(
diff --git a/packages/core/src/Interactive.tsx b/packages/core/src/Interactive.tsx
index 0e2d5a0a78..e20175f4bd 100644
--- a/packages/core/src/Interactive.tsx
+++ b/packages/core/src/Interactive.tsx
@@ -15,12 +15,12 @@ import {
borderRadiusSchema,
borderSchema,
captionsSchema,
+ childrenSchema,
cropSchema,
premountSchema,
sequenceSchema,
svgPaintSchema,
svgStrokeSchema,
- textContentSchema,
textSchema,
transformSchema,
type InteractivitySchema,
@@ -176,14 +176,14 @@ const interactiveBorderElementSchema = {
const interactiveTextElementSchema = {
...interactiveBorderElementSchema,
...textSchema,
- ...textContentSchema,
+ ...childrenSchema,
} as const satisfies InteractivitySchema;
const interactiveSvgTextElementSchema = {
...interactiveElementSchema,
...svgPaintSchema,
...textSchema,
- ...textContentSchema,
+ ...childrenSchema,
} as const satisfies InteractivitySchema;
const interactiveSvgElementSchema = {
@@ -635,6 +635,7 @@ const makeInteractiveSvgStrokeElement = <Tag extends InteractiveSvgTag>(
export const Interactive = {
baseSchema,
captionsSchema,
+ childrenSchema,
transformSchema,
textSchema,
backgroundSchema,
diff --git a/packages/core/src/interactivity-schema.ts b/packages/core/src/interactivity-schema.ts
index 0a0f741e96..62c22baf40 100644
--- a/packages/core/src/interactivity-schema.ts
+++ b/packages/core/src/interactivity-schema.ts
@@ -99,13 +99,19 @@ export type ColorFieldSchema = {
keyframable?: boolean;
};
-export type TextContentFieldSchema = {
- type: 'text-content';
+export type StringFieldSchema = {
+ type: 'string';
default: string;
description?: string;
keyframable?: false;
};
+/** @deprecated Use StringFieldSchema with type: 'string' instead. */
+export type TextContentFieldSchema = Omit<StringFieldSchema, 'type'> & {
+ /** @deprecated Use 'string' instead. */
+ type: 'text-content';
+};
+
export type SvgPathFieldSchema = {
type: 'svg-path';
default: string | undefined;
@@ -225,6 +231,7 @@ export type VisibleFieldSchema =
| ScaleFieldSchema
| UvCoordinateFieldSchema
| ColorFieldSchema
+ | StringFieldSchema
| TextContentFieldSchema
| SvgPathFieldSchema
| FontFamilyFieldSchema
@@ -478,15 +485,18 @@ export const svgPaintSchema = {
...svgStrokeSchema,
} as const satisfies InteractivitySchema;
-export const textContentSchema = {
+export const childrenSchema = {
children: {
- type: 'text-content',
+ type: 'string',
default: '',
description: 'Text',
keyframable: false,
},
} as const satisfies InteractivitySchema;
+/** @deprecated Use childrenSchema instead. */
+export const textContentSchema = childrenSchema;
+
export const premountSchema = {
premountFor: {
type: 'number',
diff --git a/packages/core/src/with-interactivity-schema.ts b/packages/core/src/with-interactivity-schema.ts
index 9951f946a1..30616f291f 100644
--- a/packages/core/src/with-interactivity-schema.ts
+++ b/packages/core/src/with-interactivity-schema.ts
@@ -66,7 +66,11 @@ export const getRuntimeValueForSchemaKey = ({
}): unknown => {
const value = getNestedValue(props, key);
- if (flatSchema[key]?.type === 'text-content' && typeof value !== 'string') {
+ if (
+ (flatSchema[key]?.type === 'string' ||
+ flatSchema[key]?.type === 'text-content') &&
+ typeof value !== 'string'
+ ) {
return undefined;
}
@@ -112,7 +116,11 @@ export const mergeValues = ({
for (const key of schemaKeys) {
const value = valuesDotNotation[key];
- if (flatSchema[key]?.type === 'text-content' && value === undefined) {
+ if (
+ (flatSchema[key]?.type === 'string' ||
+ flatSchema[key]?.type === 'text-content') &&
+ value === undefined
+ ) {
continue;
}
@@ -145,7 +153,8 @@ export const mergeValues = ({
[...propsToDelete].filter(
(key) =>
!(
- flatSchema[key]?.type === 'text-content' &&
+ (flatSchema[key]?.type === 'string' ||
+ flatSchema[key]?.type === 'text-content') &&
valuesDotNotation[key] === undefined
),
),
diff --git a/packages/docs/docs/interactive.mdx b/packages/docs/docs/interactive.mdx
index a12fb229d8..34bc3538a7 100644
--- a/packages/docs/docs/interactive.mdx
+++ b/packages/docs/docs/interactive.mdx
@@ -103,6 +103,23 @@ Controls for text-related style props:
Use it for components that accept a `style` prop and render text.
+### `Interactive.childrenSchema`<AvailableFrom v="4.0.535" />
+
+A [`string`](/docs/interactivity-schema#string) control for a component's `children` prop, labeled "Text", with a default of `''`.
+
+Use it for components that accept string children. Remotion Studio can edit a single JSX text child or string literal. Nested markup and computed expressions are read-only.
+
+Add this fragment explicitly for custom components. It is separate from `Interactive.baseSchema` and `Interactive.textSchema`, which controls typography styles.
+
+```ts twoslash title="schema.ts"
+import {Interactive, type InteractivitySchema} from 'remotion';
+
+export const labelSchema = {
+ ...Interactive.textSchema,
+ ...Interactive.childrenSchema,
+} as const satisfies InteractivitySchema;
+```
+
### `Interactive.backgroundSchema`<AvailableFrom v="4.0.497" />
A color control for `style.backgroundColor`.
diff --git a/packages/docs/docs/interactivity-schema.mdx b/packages/docs/docs/interactivity-schema.mdx
index bb7990e51d..c58ce22de0 100644
--- a/packages/docs/docs/interactivity-schema.mdx
+++ b/packages/docs/docs/interactivity-schema.mdx
@@ -63,6 +63,23 @@ Text-related style props: `style.color`, `style.fontFamily`, `style.fontSize`, `
`style.fontFamily` is available from <AvailableFrom v="4.0.486" inline />.
+### `Interactive.childrenSchema`<AvailableFrom v="4.0.535" />
+
+A [`string`](#string) field named `children`, labeled "Text", with a default of `''`.
+
+Use it for components that accept string children. It edits a single JSX text child, a string literal expression such as `{'Hello'}`, or a literal `children="Hello"` prop. Nested markup and computed expressions are read-only.
+
+This fragment edits content. [`Interactive.textSchema`](#interactivetextschema) edits typography styles. `childrenSchema` is separate from `baseSchema` and must be added explicitly for custom components.
+
+```ts twoslash title="schema.ts"
+import {Interactive, type InteractivitySchema} from 'remotion';
+
+export const labelSchema = {
+ ...Interactive.textSchema,
+ ...Interactive.childrenSchema,
+} as const satisfies InteractivitySchema;
+```
+
### `Interactive.backgroundSchema`<AvailableFrom v="4.0.497" />
A color control for `style.backgroundColor`.
@@ -105,26 +122,32 @@ Shows an on/off control.
Shows a color control. The value is a CSS color string.
-### `text-content`
+### `string`<AvailableFrom v="4.0.535" />
-Shows a text control for a string prop, such as a title.
+Shows a text control for a string prop, such as a title, prompt, or code snippet.
Remotion Studio can edit a string literal, such as `title="Hello"`. Other expressions are shown as read-only.
-Text content fields are not keyframable.
+String fields are not keyframable.
```ts twoslash title="schema.ts"
import type {InteractivitySchema} from 'remotion';
export const schema = {
title: {
- type: 'text-content',
+ type: 'string',
default: '',
description: 'Title',
},
} as const satisfies InteractivitySchema;
```
+### ~~`text-content`~~
+
+:::info Deprecated
+Use [`string`](#string) instead. `text-content` remains supported as an alias with the same behavior.
+:::
+
### `asset`
Shows a control for selecting an asset source.
@@ -300,7 +323,7 @@ Default: `true` for `number`, `boolean`, `rotation-css`, `rotation-degrees`, `tr
Boolean fields use hold keyframes: their value changes at the next keyframe without blending. Boolean keyframes are available from <AvailableFrom v="4.0.530" inline />.
-`array`, `asset`, `font-family`, `text-content` and `remotion-captions` fields are not keyframable. Fields inside an `enum` variant schema can still be keyframed according to their own `keyframable` setting.
+`array`, `asset`, `font-family`, `string`, `text-content` and `remotion-captions` fields are not keyframable. Fields inside an `enum` variant schema can still be keyframed according to their own `keyframable` setting.
`enum` fields are not keyframable by default. From <AvailableFrom v="4.0.509" inline />, set `keyframable: true` to enable hold keyframes. Remotion Studio generates [`Easing.step1`](/docs/easing#step1) segments because enum values cannot be blended.
diff --git a/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx b/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx
index 2ed073f473..11eccbd1e8 100644
--- a/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx
+++ b/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx
@@ -50,12 +50,12 @@ const mapFlyoverSchema = {
description: 'Destination [longitude, latitude]',
},
originLabel: {
- type: 'text-content',
+ type: 'string',
default: 'London',
description: 'Origin label',
},
destinationLabel: {
- type: 'text-content',
+ type: 'string',
default: 'Tokyo',
description: 'Destination label',
},
diff --git a/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx b/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx
index 3f92bd4be9..d74204e93d 100644
--- a/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx
+++ b/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx
@@ -52,12 +52,12 @@ const watercolorMapSchema = {
description: 'Destination [longitude, latitude]',
},
originLabel: {
- type: 'text-content',
+ type: 'string',
default: 'Los Angeles',
description: 'Origin label',
},
destinationLabel: {
- type: 'text-content',
+ type: 'string',
default: 'Zurich',
description: 'Destination label',
},
diff --git a/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx b/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx
index 6c86ebaaf9..646e06da40 100644
--- a/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx
+++ b/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx
@@ -21,7 +21,7 @@ type SpinningTextWheelProps = InteractiveTransformProps & {
const spinningTextWheelSchema = {
items: {
- type: 'text-content',
+ type: 'string',
default: 'Friday\nSaturday\nSunday\nMonday\nTuesday\nWednesday\nThursday',
description: 'Items (selected first, one per line)',
},
diff --git a/packages/effects/src/lut/index.ts b/packages/effects/src/lut/index.ts
index 145258b440..cecff93cda 100644
--- a/packages/effects/src/lut/index.ts
+++ b/packages/effects/src/lut/index.ts
@@ -19,7 +19,7 @@ LUT_3D_SIZE 2
export const lutSchema = {
content: {
- type: 'text-content',
+ type: 'string',
default: DEFAULT_LUT_CONTENT,
description: 'Cube LUT content',
keyframable: false,
diff --git a/packages/example/src/Portfolio/components/ChapterTag.tsx b/packages/example/src/Portfolio/components/ChapterTag.tsx
index ba2a22e49b..8d7efb956b 100644
--- a/packages/example/src/Portfolio/components/ChapterTag.tsx
+++ b/packages/example/src/Portfolio/components/ChapterTag.tsx
@@ -67,8 +67,8 @@ const ChapterTagInner: React.FC<Props> = ({
};
const chapterTagSchema = {
- index: {type: 'text-content', default: '01', description: 'Chapter number'},
- title: {type: 'text-content', default: '', description: 'Chapter title'},
+ index: {type: 'string', default: '01', description: 'Chapter number'},
+ title: {type: 'string', default: '', description: 'Chapter title'},
color: {type: 'color', default: '#F3EFE6', description: 'Text color'},
start: {
type: 'number',
diff --git a/packages/example/src/Portfolio/components/RiseText.tsx b/packages/example/src/Portfolio/components/RiseText.tsx
index 9dbc620a23..89f1836b53 100644
--- a/packages/example/src/Portfolio/components/RiseText.tsx
+++ b/packages/example/src/Portfolio/components/RiseText.tsx
@@ -80,7 +80,7 @@ const RiseTextInner: React.FC<Props> = ({
};
const riseTextSchema = {
- text: {type: 'text-content', default: '', description: 'Text'},
+ text: {type: 'string', default: '', description: 'Text'},
start: {
type: 'number',
default: 0,
diff --git a/packages/example/src/Portfolio/components/Typewriter.tsx b/packages/example/src/Portfolio/components/Typewriter.tsx
index f886299fd7..df1e9f49b6 100644
--- a/packages/example/src/Portfolio/components/Typewriter.tsx
+++ b/packages/example/src/Portfolio/components/Typewriter.tsx
@@ -52,7 +52,7 @@ const TypewriterInner: React.FC<Props> = ({
};
const typewriterSchema = {
- text: {type: 'text-content', default: '', description: 'Text'},
+ text: {type: 'string', default: '', description: 'Text'},
start: {
type: 'number',
default: 0,
diff --git a/packages/jonnys-videos/src/roller-skis/IntroLowerThird.tsx b/packages/jonnys-videos/src/roller-skis/IntroLowerThird.tsx
index dc0b097f86..2404660e9b 100644
--- a/packages/jonnys-videos/src/roller-skis/IntroLowerThird.tsx
+++ b/packages/jonnys-videos/src/roller-skis/IntroLowerThird.tsx
@@ -95,12 +95,12 @@ const IntroLowerThirdContent: React.FC<IntroLowerThirdProps> = ({
const lowerThirdSchema = {
nameText: {
- type: 'text-content',
+ type: 'string',
default: 'Jonny Burger',
description: 'Name',
},
roleText: {
- type: 'text-content',
+ type: 'string',
default: 'Roller Ski Enthusiast',
description: 'Role',
},
diff --git a/packages/jonnys-videos/src/roller-skis/blueprint/CodeCard.tsx b/packages/jonnys-videos/src/roller-skis/blueprint/CodeCard.tsx
index 6a975b4784..7ceee8abdb 100644
--- a/packages/jonnys-videos/src/roller-skis/blueprint/CodeCard.tsx
+++ b/packages/jonnys-videos/src/roller-skis/blueprint/CodeCard.tsx
@@ -115,14 +115,14 @@ const CodeCardInner: React.FC<CodeCardProps> = ({
const codeCardSchema = {
header: {
- type: 'text-content',
+ type: 'string',
default: '// ski.system',
description: 'Header',
},
- line1: {type: 'text-content', default: '', description: 'Line 01'},
- line2: {type: 'text-content', default: '', description: 'Line 02'},
- line3: {type: 'text-content', default: '', description: 'Line 03'},
- line4: {type: 'text-content', default: '', description: 'Line 04'},
+ line1: {type: 'string', default: '', description: 'Line 01'},
+ line2: {type: 'string', default: '', description: 'Line 02'},
+ line3: {type: 'string', default: '', description: 'Line 03'},
+ line4: {type: 'string', default: '', description: 'Line 04'},
typeSeconds: {
type: 'number',
default: 1.5,
diff --git a/packages/mac-cursors/src/MacOSCursor.tsx b/packages/mac-cursors/src/MacOSCursor.tsx
index 3923f7ee2e..3c36c08aa7 100644
--- a/packages/mac-cursors/src/MacOSCursor.tsx
+++ b/packages/mac-cursors/src/MacOSCursor.tsx
@@ -38,7 +38,7 @@ export const macOSCursorSchema: InteractivitySchema = {
{
custom: {
customCursor: {
- type: 'text-content',
+ type: 'string',
default: '',
description: 'Custom cursor',
keyframable: false,
diff --git a/packages/rough-notation/src/Annotation.tsx b/packages/rough-notation/src/Annotation.tsx
index 19027a9b1b..cc2b2e075e 100644
--- a/packages/rough-notation/src/Annotation.tsx
+++ b/packages/rough-notation/src/Annotation.tsx
@@ -206,15 +206,6 @@ const underlinePaddingSchema = {
'padding.top': paddingSchema['padding.top'],
} as const satisfies InteractivitySchema;
-const textContentSchema = {
- children: {
- type: 'text-content',
- default: '',
- description: 'Text',
- keyframable: false,
- },
-} as const satisfies InteractivitySchema;
-
const sharedSchema = (defaultRoughness: number): InteractivitySchema => ({
...Interactive.baseSchema,
...Interactive.premountSchema,
@@ -242,7 +233,7 @@ const sharedSchema = (defaultRoughness: number): InteractivitySchema => ({
...roughJsControlsSchema(defaultRoughness),
...colorSchema,
...Interactive.textSchema,
- ...textContentSchema,
+ ...Interactive.childrenSchema,
...Interactive.backgroundSchema,
...Interactive.borderSchema,
...Interactive.borderRadiusSchema,
diff --git a/packages/skills/skills/remotion-interactivity/SKILL.md b/packages/skills/skills/remotion-interactivity/SKILL.md
index 81fb719ff4..862e73bf86 100644
--- a/packages/skills/skills/remotion-interactivity/SKILL.md
+++ b/packages/skills/skills/remotion-interactivity/SKILL.md
@@ -73,7 +73,7 @@ const LowerThirdInner: React.FC<LowerThirdProps> = ({
};
const lowerThirdSchema = {
- children: {type: 'text-content', default: '', description: 'Text'},
+ ...Interactive.childrenSchema,
accentColor: {
type: 'color',
default: '#0b84f3',
@@ -100,7 +100,7 @@ Keys may use dot notation, such as `style.color`.
| Type | Use for | Keyframable |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------ | ------------- |
-| `text-content` | Text, such as a title | No |
+| `string` | Strings, such as a title, prompt, or code snippet | No |
| `number` | Numbers, with optional `min`, `max`, `step`, `integer` | Yes |
| `boolean` | On/off switches | Yes (hold) |
| `color` | CSS color strings | Yes |
@@ -132,6 +132,12 @@ const cardSchema = {
```
Also available: `Interactive.borderSchema`, and `Interactive.captionsSchema` for components that accept captions.
+For components that accept string children, add `...Interactive.childrenSchema`.
+It provides a `children` string field labeled "Text" with a default of `''`.
+`Interactive.textSchema` controls typography styles; `childrenSchema` controls content.
+The children fragment is not included in `baseSchema` or automatically added to custom components.
+Nested markup and computed children remain read-only.
+`text-content` is a deprecated alias for the `string` field type.
See [`InteractivitySchema`](https://www.remotion.dev/docs/interactivity-schema) for all options.
### Register reusable components as connected compositions
diff --git a/packages/skills/skills/remotion-markup/SKILL.md b/packages/skills/skills/remotion-markup/SKILL.md
index a65583bc96..57a0e8a004 100644
--- a/packages/skills/skills/remotion-markup/SKILL.md
+++ b/packages/skills/skills/remotion-markup/SKILL.md
@@ -237,7 +237,7 @@ const LowerThirdInner: React.FC<LowerThirdProps> = ({
};
const lowerThirdSchema = {
- children: { type: "text-content", default: "", description: "Text" },
+ ...Interactive.childrenSchema,
accentColor: {
type: "color",
default: "#0b84f3",
diff --git a/packages/skills/skills/remotion-markup/connected-compositions.md b/packages/skills/skills/remotion-markup/connected-compositions.md
index bc6b8af910..bea2b835ea 100644
--- a/packages/skills/skills/remotion-markup/connected-compositions.md
+++ b/packages/skills/skills/remotion-markup/connected-compositions.md
@@ -73,7 +73,7 @@ const ChapterInner: React.FC<ChapterProps> = ({title, style}) => {
};
const chapterSchema = {
- title: {type: 'text-content', default: '', description: 'Title'},
+ title: {type: 'string', default: '', description: 'Title'},
} as const satisfies InteractivitySchema;
export const Chapter = Interactive.withSchema({
diff --git a/packages/studio-shared/src/keyframe-clipboard-data.ts b/packages/studio-shared/src/keyframe-clipboard-data.ts
index 533b19e9b0..fd66ed7053 100644
--- a/packages/studio-shared/src/keyframe-clipboard-data.ts
+++ b/packages/studio-shared/src/keyframe-clipboard-data.ts
@@ -22,6 +22,7 @@ const KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT = {
'rotation-degrees': true,
scale: true,
'svg-path': true,
+ string: false,
'text-content': false,
'transform-origin': true,
translate: true,
diff --git a/packages/studio-shared/src/keyframe-interpolation-function.ts b/packages/studio-shared/src/keyframe-interpolation-function.ts
index fed3dbc78c..4b085b9026 100644
--- a/packages/studio-shared/src/keyframe-interpolation-function.ts
+++ b/packages/studio-shared/src/keyframe-interpolation-function.ts
@@ -30,6 +30,7 @@ const KEYFRAME_FIELD_TYPE_SUPPORT = {
'rotation-degrees': true,
scale: true,
'svg-path': true,
+ string: false,
'text-content': false,
'transform-origin': true,
translate: true,
@@ -56,6 +57,7 @@ const KEYFRAME_FIELD_TYPE_INTERPOLATION = {
'rotation-degrees': 'infer',
scale: 'interpolate',
'svg-path': 'interpolatePaths',
+ string: 'unsupported',
'text-content': 'unsupported',
'transform-origin': 'interpolate',
translate: 'interpolate',
@@ -80,6 +82,7 @@ const KEYFRAME_FIELD_TYPE_OUTPUT_TYPE = {
'rotation-degrees': null,
scale: 'scale',
'svg-path': null,
+ string: null,
'text-content': null,
'transform-origin': 'transform-origin',
translate: 'translate',
diff --git a/packages/studio-shared/src/schema-field-info.ts b/packages/studio-shared/src/schema-field-info.ts
index 532d5bad13..ae7d28254a 100644
--- a/packages/studio-shared/src/schema-field-info.ts
+++ b/packages/studio-shared/src/schema-field-info.ts
@@ -233,6 +233,7 @@ const TIMELINE_SCHEMA_FIELD_TYPE_SUPPORT = {
'rotation-degrees': true,
scale: true,
'svg-path': true,
+ string: true,
'text-content': true,
'transform-origin': true,
translate: true,
@@ -376,7 +377,11 @@ export const getFieldsToShow = ({
return null;
}
- if (fieldSchema.type === 'text-content' && !includeTextContent) {
+ if (
+ (fieldSchema.type === 'string' ||
+ fieldSchema.type === 'text-content') &&
+ !includeTextContent
+ ) {
return null;
}
diff --git a/packages/studio/src/components/InspectorPanel/MultiSequenceField.tsx b/packages/studio/src/components/InspectorPanel/MultiSequenceField.tsx
index 96c89a17f8..41e9b106f7 100644
--- a/packages/studio/src/components/InspectorPanel/MultiSequenceField.tsx
+++ b/packages/studio/src/components/InspectorPanel/MultiSequenceField.tsx
@@ -113,6 +113,7 @@ export const MultiSequenceField: React.FC<{
fieldKey: field.key,
value: nextValues[index],
defaultValue:
+ field.typeName === 'string' ||
field.typeName === 'text-content' ||
field.fieldSchema.default === undefined
? null
@@ -209,7 +210,9 @@ export const MultiSequenceField: React.FC<{
codeValue: mixed ? undefined : values[0],
}}
scaleLockNodePath={
- field.typeName === 'text-content' ? null : targets[0].nodePath
+ field.typeName === 'string' || field.typeName === 'text-content'
+ ? null
+ : targets[0].nodePath
}
onSave={(value, options) =>
save(
diff --git a/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx b/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx
index b65706f763..9a2052458f 100644
--- a/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx
+++ b/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx
@@ -474,7 +474,7 @@ export const TimelineEffectPropItem: React.FC<{
const selection = useTimelineRowSelection(nodePathInfo, revealInInspector);
const containsSelection = useTimelineRowContainsSelection(nodePathInfo);
const style = useMemo((): React.CSSProperties => {
- return field.typeName === 'text-content'
+ return field.typeName === 'string' || field.typeName === 'text-content'
? fieldRowBase
: {...fieldRowBase, height: field.rowHeight};
}, [field.rowHeight, field.typeName]);
diff --git a/packages/studio/src/components/Timeline/TimelinePrimitiveFieldValue.tsx b/packages/studio/src/components/Timeline/TimelinePrimitiveFieldValue.tsx
index 328cda9b53..fb710c3e12 100644
--- a/packages/studio/src/components/Timeline/TimelinePrimitiveFieldValue.tsx
+++ b/packages/studio/src/components/Timeline/TimelinePrimitiveFieldValue.tsx
@@ -219,7 +219,11 @@ export const TimelinePrimitiveFieldValue: React.FC<{
);
}
- if (field.typeName === 'text-content' || field.typeName === 'svg-path') {
+ if (
+ field.typeName === 'string' ||
+ field.typeName === 'text-content' ||
+ field.typeName === 'svg-path'
+ ) {
return (
<TimelineTextContentField
effectiveValue={effectiveValue}
diff --git a/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx b/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx
index d6c46d7778..90014f0b9e 100644
--- a/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx
@@ -246,6 +246,7 @@ const Value: React.FC<{
}
const defaultValue =
+ field.fieldSchema.type === 'string' ||
field.fieldSchema.type === 'text-content'
? null
: field.fieldSchema.default !== undefined
diff --git a/packages/studio/src/components/Timeline/timeline-field-display-utils.ts b/packages/studio/src/components/Timeline/timeline-field-display-utils.ts
index 2e893b81b3..3f78e7e24e 100644
--- a/packages/studio/src/components/Timeline/timeline-field-display-utils.ts
+++ b/packages/studio/src/components/Timeline/timeline-field-display-utils.ts
@@ -396,6 +396,7 @@ export const formatTimelineFieldValueForDisplay = ({
formatUnknownTimelineValueForDisplay(value)
);
+ case 'string':
case 'text-content':
case 'svg-path':
return String(value);
diff --git a/packages/studio/src/components/Timeline/timeline-field-row-layout.ts b/packages/studio/src/components/Timeline/timeline-field-row-layout.ts
index eb01a77268..86eefb61d4 100644
--- a/packages/studio/src/components/Timeline/timeline-field-row-layout.ts
+++ b/packages/studio/src/components/Timeline/timeline-field-row-layout.ts
@@ -15,6 +15,7 @@ export const isTimelineFieldStacked = ({
readonly transform3DMode: boolean;
}) => {
return (
+ field.typeName === 'string' ||
field.typeName === 'text-content' ||
field.typeName === 'svg-path' ||
(transform3DMode &&
diff --git a/packages/template-helloworld/src/HelloWorld/Title.tsx b/packages/template-helloworld/src/HelloWorld/Title.tsx
index 2ef71b5c59..7942954034 100644
--- a/packages/template-helloworld/src/HelloWorld/Title.tsx
+++ b/packages/template-helloworld/src/HelloWorld/Title.tsx
@@ -50,7 +50,7 @@ const TitleInner: React.FC<TitleProps> = ({ titleText, titleColor, style }) => {
};
const titleSchema = {
- titleText: { type: "text-content", default: "Welcome to Remotion", description: "Title" },
+ titleText: { type: "string", default: "Welcome to Remotion", description: "Title" },
titleColor: { type: "color", default: "#000000", description: "Title color" },
} as const satisfies InteractivitySchema;
diff --git a/packages/template-vibe-code/src/editor/components/Inspector/LayerInspector.tsx b/packages/template-vibe-code/src/editor/components/Inspector/LayerInspector.tsx
index 59442d4a93..daf396e869 100644
--- a/packages/template-vibe-code/src/editor/components/Inspector/LayerInspector.tsx
+++ b/packages/template-vibe-code/src/editor/components/Inspector/LayerInspector.tsx
@@ -482,6 +482,7 @@ const PropFieldEditor: React.FC<PropFieldEditorProps> = ({
</FieldRow>
);
+ case "string":
case "text-content":
return (
<FieldRow
diff --git a/packages/template-vibe-code/src/editor/model/schemas.ts b/packages/template-vibe-code/src/editor/model/schemas.ts
index 5e13fb1437..553a31e0aa 100644
--- a/packages/template-vibe-code/src/editor/model/schemas.ts
+++ b/packages/template-vibe-code/src/editor/model/schemas.ts
@@ -11,14 +11,6 @@ import type { Layer } from "./layers";
// schemas composed below from the public `Interactive.*Schema` fragments are
// the fallback for elements that are not mounted, e.g. while hidden.
-const textContentSchema: InteractivitySchema = {
- children: {
- type: "text-content",
- default: "",
- description: "Text",
- },
-};
-
const assetSchema = (
assetType: "image" | "video" | "audio",
): InteractivitySchema => ({
@@ -56,7 +48,7 @@ const htmlElementSchema: InteractivitySchema = {
...Interactive.borderSchema,
...Interactive.borderRadiusSchema,
...Interactive.textSchema,
- ...textContentSchema,
+ ...Interactive.childrenSchema,
};
const svgElementSchema: InteractivitySchema = {
@@ -372,6 +364,7 @@ export const getVisibleFields = (
"transform-origin",
"scale",
"color",
+ "string",
"text-content",
"font-family",
"font-weight",