Skip to main content

makeRect()

import {MakeShapeSeeAlso, ShapeOptions, MakeShapeReturnType} from "../../components/shapes/shapes-info"

Part of the @remotion/shapes package.

Generates an SVG rectangle.

Example

rect.ts
tsx
import { makeRect } from "@remotion/shapes";
 
const { path, width, height, transformOrigin } = makeRect({
width: 100,
height: 100,
});
 
console.log(path); // M 0 0 l 100 0 l 0 100 l -100 0 Z
console.log(width); // 100
console.log(height); // 100
console.log(transformOrigin); // '50 50'
rect.ts
tsx
import { makeRect } from "@remotion/shapes";
 
const { path, width, height, transformOrigin } = makeRect({
width: 100,
height: 100,
});
 
console.log(path); // M 0 0 l 100 0 l 0 100 l -100 0 Z
console.log(width); // 100
console.log(height); // 100
console.log(transformOrigin); // '50 50'

Arguments

Return type

See also