Archived docs Get your API Key
Get started
Tutorials
Guides
Reference
Help for coding 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
leftstring—Left position (e.g. '20%', '10vw').
topstring—Top position.
widthstring—Width (e.g. '60%', '40vw').
heightstring—Height.
backgroundstring—CSS background: color, gradient (e.g. 'radial-gradient(...)'), or empty.
background-colorstring—Background color.
background-imagestring—Background image URL (use with background-size and background-position).
background-sizestring—Background size (e.g. 'cover', 'contain').
background-positionstring—Background position (e.g. 'center').
border-radiusstring—Corner rounding. Use '50%' for circle.
border-colorstring—Border color.
border-stylestring—Border style (solid, dashed, etc.).
border-widthstring—Border width.
outline-stylestring—Outline style.
outline-colorstring—Outline color.
outline-widthstring—Outline width.
box-shadowstring—CSS box shadow.
rotatestring—CSS rotation (e.g. '30deg').
transformstring—CSS transform.
opacitystring—Opacity (0-1).
animateobject—Keyframe 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).