Back to Remotion

Rect

packages/docs/docs/shapes/rect.mdx

4.0.474718 B
Original Source

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

Part of the @remotion/shapes package.

Renders an SVG element containing a rectangle.

Explorer

<Demo type="rect"/>

Example

tsx
import { Rect } from "@remotion/shapes";
import { AbsoluteFill } from "remotion";

export const MyComposition = () => {
  return (
    <AbsoluteFill
      style={{
        backgroundColor: "white",
        justifyContent: "center",
        alignItems: "center",
      }}
    >
      <Rect width={200} height={200} fill="red" />
    </AbsoluteFill>
  );
};

Props

<ShapeOptions shape="rect" all />

See also

<ShapeSeeAlso shape="rect"/>