Skip to content

🎥 Make videos programmatically with React

Keep children schema open to richer content

Jonny Burgerf844903ca850
diff --git a/packages/brand/src/Compose/WhatIsRemotion.tsx b/packages/brand/src/Compose/WhatIsRemotion.tsx
index 63669bd790..e2540969c5 100644
--- a/packages/brand/src/Compose/WhatIsRemotion.tsx
+++ b/packages/brand/src/Compose/WhatIsRemotion.tsx
@@ -33,7 +33,7 @@ import {Rotations} from './Rotations';
type LabelProps = InteractiveBaseProps &
InteractiveTransformProps & {
- readonly children: string;
+ readonly children: React.ReactNode;
};
const labelSchema = {
diff --git a/packages/core/src/interactivity-schema.ts b/packages/core/src/interactivity-schema.ts
index 62c22baf40..e61a59743f 100644
--- a/packages/core/src/interactivity-schema.ts
+++ b/packages/core/src/interactivity-schema.ts
@@ -485,14 +485,18 @@ export const svgPaintSchema = {
...svgStrokeSchema,
} as const satisfies InteractivitySchema;
-export const childrenSchema = {
+/**
+ * Controls for children content. Currently uses a string field, but the field
+ * type may evolve to support richer content.
+ */
+export const childrenSchema: {children: InteractivitySchemaField} = {
children: {
type: 'string',
default: '',
description: 'Text',
keyframable: false,
},
-} as const satisfies InteractivitySchema;
+};
/** @deprecated Use childrenSchema instead. */
export const textContentSchema = childrenSchema;
diff --git a/packages/docs/docs/interactive.mdx b/packages/docs/docs/interactive.mdx
index 34bc3538a7..f54af924f7 100644
--- a/packages/docs/docs/interactive.mdx
+++ b/packages/docs/docs/interactive.mdx
@@ -105,9 +105,11 @@ 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 `''`.
+A schema fragment for editing a component's children content.
-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.
+Currently, it uses a [`string`](/docs/interactivity-schema#string) control labeled "Text", with a default of `''`. Remotion Studio can edit a single JSX text child or string literal. Nested markup and computed expressions are currently read-only.
+
+The fragment may evolve to support richer content. Use it with components that accept `React.ReactNode` children. For string-only children, declare an explicit [`string`](/docs/interactivity-schema#string) field instead.
Add this fragment explicitly for custom components. It is separate from `Interactive.baseSchema` and `Interactive.textSchema`, which controls typography styles.
diff --git a/packages/docs/docs/interactivity-schema.mdx b/packages/docs/docs/interactivity-schema.mdx
index c58ce22de0..9d259016c9 100644
--- a/packages/docs/docs/interactivity-schema.mdx
+++ b/packages/docs/docs/interactivity-schema.mdx
@@ -65,9 +65,11 @@ Text-related style props: `style.color`, `style.fontFamily`, `style.fontSize`, `
### `Interactive.childrenSchema`<AvailableFrom v="4.0.535" />
-A [`string`](#string) field named `children`, labeled "Text", with a default of `''`.
+A schema fragment for editing the content passed through a component's `children` prop.
-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.
+Currently, it uses a [`string`](#string) control labeled "Text", with a default of `''`. 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 currently read-only.
+
+The fragment may evolve to support richer children content. Use it with components that accept `React.ReactNode` children. If your component requires string-only children, declare an explicit [`string`](#string) field instead.
This fragment edits content. [`Interactive.textSchema`](#interactivetextschema) edits typography styles. `childrenSchema` is separate from `baseSchema` and must be added explicitly for custom components.
diff --git a/packages/skills/skills/remotion-interactivity/SKILL.md b/packages/skills/skills/remotion-interactivity/SKILL.md
index 862e73bf86..6625cae5c5 100644
--- a/packages/skills/skills/remotion-interactivity/SKILL.md
+++ b/packages/skills/skills/remotion-interactivity/SKILL.md
@@ -30,7 +30,7 @@ import type React from 'react';
import {Interactive, type InteractivitySchema} from 'remotion';
type LowerThirdProps = {
- readonly children: string;
+ readonly children: React.ReactNode;
readonly accentColor: string;
readonly style?: React.CSSProperties;
};
@@ -132,11 +132,13 @@ 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 `''`.
+For components that accept `React.ReactNode` children, add `...Interactive.childrenSchema`.
+It provides controls for children content and may evolve to support richer content.
+Currently, it uses a string field labeled "Text" with a default of `''`.
+If a component requires string-only children, declare an explicit `children` field with `type: 'string'` instead.
`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.
+Nested markup and computed children are currently 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.
diff --git a/packages/skills/skills/remotion-markup/SKILL.md b/packages/skills/skills/remotion-markup/SKILL.md
index 57a0e8a004..48cebce73c 100644
--- a/packages/skills/skills/remotion-markup/SKILL.md
+++ b/packages/skills/skills/remotion-markup/SKILL.md
@@ -194,7 +194,7 @@ import type React from "react";
import { Interactive, type InteractivitySchema } from "remotion";
type LowerThirdProps = {
- readonly children: string;
+ readonly children: React.ReactNode;
readonly accentColor: string;
readonly style?: React.CSSProperties;
};