Archived docs Get your API Key
Get started
Tutorials
Guides
Reference
Help for AI agents
🤖 AI Assistant

Component shape/rectangle

Component ID: shape/rectangle

A highly versatile component that renders up to 10 independent rectangles, each with its own position, size, styling, and keyframe animation. This is the building block for many visual effects: simple shapes, colored backgrounds, gradient backgrounds, image displays, moving elements, wipe transitions, vignette effects, and more. Each rectangle supports CSS background (solid colors, gradients, images), borders, border-radius (use 50% for circles), box-shadow, and keyframe animations for position, size, rotation, and more.

SectionAnimated geometric shapes, rectangles, polygons, cutouts, and custom HTML/SVG
AnimationEach rectangle has its own 'animate' block with keyframe targets, duration, easing, and delay. Rectangles without animate blocks are static.
Intro duration0 s

Preview

Element schema

Minimal shape of a shape/rectangle component element:

{
    "type": "component",
    "component": "shape/rectangle",
    "settings": {}
}

See the full component element reference for shared properties like duration, start, x, y, etc.

Settings

The settings property accepts the following groups. Each group contains CSS-like properties; see component CSS properties for the full list of supported keys.

rectangle1

First rectangle (required). Use rectangle2-rectangle10 for additional rectangles with the same property structure.

PropertyTypeDefaultDescription
leftstringLeft position (e.g. '20%', '10vw').
topstringTop position.
widthstringWidth (e.g. '60%', '40vw').
heightstringHeight.
backgroundstringCSS background: color, gradient (e.g. 'radial-gradient(...)'), or empty.
background-colorstringBackground color.
background-imagestringBackground image URL (use with background-size and background-position).
background-sizestringBackground size (e.g. 'cover', 'contain').
background-positionstringBackground position (e.g. 'center').
border-radiusstringCorner rounding. Use '50%' for circle.
border-colorstringBorder color.
border-stylestringBorder style (solid, dashed, etc.).
border-widthstringBorder width.
outline-stylestringOutline style.
outline-colorstringOutline color.
outline-widthstringOutline width.
box-shadowstringCSS box shadow.
rotatestringCSS rotation (e.g. '30deg').
transformstringCSS transform.
opacitystringOpacity (0-1).
animateobjectKeyframe animation. Set target CSS values that the rectangle animates TO from its initial state. Properties: any CSS property as target + 'duration' (ms), 'easing' (anime.js), 'delay' (ms).