Skip to main content

focusDefaultPropsPath()v4.0.165

Scrolls to a specific field in the default props editor.

Example

For the following Zod schema:

schema.ts
tsx
import { z } from "zod";
 
const MySchema = z.object({
array: z.array(
z.object({
subfield: z.string(),
}),
),
});
schema.ts
tsx
import { z } from "zod";
 
const MySchema = z.object({
array: z.array(
z.object({
subfield: z.string(),
}),
),
});

Call focusDefaultPropsPath() with the path to the field you want to focus on:

MyComp.tsx
tsx
import { focusDefaultPropsPath } from "@remotion/studio";
 
focusDefaultPropsPath({
path: ["array", 0, "subfield"],
});
MyComp.tsx
tsx
import { focusDefaultPropsPath } from "@remotion/studio";
 
focusDefaultPropsPath({
path: ["array", 0, "subfield"],
});

API

path

The path to the field you want to focus on. An array containing numbers and strings.

scrollBehavior

The behavior of the scrolling.
One of "auto" | "instant" | "smooth".
Defaults to the default scroll behavior.

See also