Back to Remotion

focusDefaultPropsPath()

packages/docs/docs/studio/focus-default-props-path.mdx

4.0.4661.1 KB
Original Source

focusDefaultPropsPath()<AvailableFrom v="4.0.165"/>

Scrolls to a specific field in the default props editor.

Example

For the following Zod schema:

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:

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