Skip to content

Rect

The <Rect> primitive renders an SVG rectangle. It supports rounded corners, fill, stroke, and dashed outlines — useful for bounding boxes, containers, highlights, and background regions.

0.00s / 2.97s · F0
PropTypeDefaultDescription
xnumber0X coordinate of the top-left corner
ynumber0Y coordinate of the top-left corner
widthnumber0Width of the rectangle
heightnumber0Height of the rectangle
fillstring'none'Fill color
strokestring'currentColor'Stroke color
strokeWidthnumber1Width of the stroke
rxnumber0Corner radius for rounded rectangles
strokeDasharraystringundefinedDash pattern (e.g. "6 3")
opacitynumber1Opacity from 0 to 1
import { Player, FadeIn, Rect } from '@elucim/core';
<Player width={500} height={300} fps={30} durationInFrames={60}>
<FadeIn duration={20}>
<Rect x={50} y={50} width={180} height={100} stroke="#6c5ce7" strokeWidth={2} fill="rgba(108,92,231,0.15)" rx={8} />
</FadeIn>
<FadeIn duration={20}>
<Rect x={280} y={80} width={120} height={120} stroke="#ff6b6b" strokeWidth={2} fill="none" />
</FadeIn>
</Player>