Capítulo 924 de 988

Chapter 924: zMatrix()

Core Idea

With this type, you can visually edit a matrix in the Props Editor.

Key Concepts

  • See also

Code Examples

const myCompSchema = z.object({
  matrix: zMatrix(),
});

// Two-dimensional matrix
myCompSchema.parse({
  matrix: [0, 1, 1, 0],
});

// Three-dimensional matrix
myCompSchema.parse({
  matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1],
});

// Four-dimensional matrix
myCompSchema.parse({
  matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
});
  • What it demonstrates: Usage pattern for zMatrix() from the official docs.

Key Takeaways

  1. Understand see also when working with zMatrix().

Connects To

  • v3: related page in the Zod Types (@remotion/zod-types) section.
  • z Color: related page in the Zod Types (@remotion/zod-types) section.
  • z Textarea: related page in the Zod Types (@remotion/zod-types) section.