Sugar for a childless <frame>. Signals decorative intent — no layout children. w and h are required.

rect

tagrectangle

Sugar for a childless <frame>. Signals decorative intent — no layout children. w and h are required.

Supports all visual attributes: fill, border, radius, opacity, blend, rotation, appearance. Does not accept layout attributes.

Border shorthand: "[width] [color] [style] [align]". Defaults: 1px solid center.

AttrTypeDescription
namestring
xnumber
ynumber
w requirednumber | 'fill'Unified width. Replaces width + sizing-h. Absent = hug (valid on row/col/stack/text/instance only). "fill" = grow to fill parent. number = fixed px. String forms: '50%' (of parent), '1.5rem', '100vw', 'calc(100% - 16px)' Not valid on frame/img/svg — those require explicit values.
h requirednumber | 'fill'Unified height. Replaces height + sizing-v. Absent = hug (valid on row/col/stack/text/instance only). "fill" = grow to fill parent. number = fixed px. String forms: '50%' (of parent), '1.5rem', '100vh', 'calc(100% - 16px)' Not valid on frame/img/svg — those require explicit values.
fillfill
fill-stylestring
effect-stylestring
radiusnumber | string
corner-smoothingnumber
borderstring
border-colorcolor | token
border-widthnumber
border-stylesolid dashed dotted
border-aligncenter inside outside
shadowstring
fill-rulenonzero evenodd

Inherited properties

AttrType / valuesNotes
opacitynumberLayer opacity, 0–1. Omitted when 1.
blendnormal, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color, luminosity, linear-burn, linear-dodgeBlend mode against layers below. Omitted when normal.
maskbooleanPresence = true. Acts as an alpha mask for subsequent siblings.
rotationnumberRotation in degrees. Omitted when 0.
constraint-hleft, right, center, scale, stretchHorizontal pin/resize behavior. Default left (omitted).
constraint-vcenter, scale, stretch, top, bottomVertical pin/resize behavior. Default top (omitted).
absbooleanAbsolute child inside auto-layout. Presence = true. Replaces layout-position="absolute".
min-widthnumberMinimum width in px. Omitted when unset.
max-widthnumberMaximum width in px. Omitted when unset.
min-heightnumberMinimum height in px. Omitted when unset.
max-heightnumberMaximum height in px. Omitted when unset.
fliph, v, bothMirror transform — 'h', 'v', or 'both'.
filterstringCSS filter string, e.g. "brightness(1.2) contrast(0.9)".
isolationbooleanPresence = true. New stacking context for blend modes (isolation: isolate).
transform-originstringTransform origin, e.g. "top-left", "center", "0% 0%".
scale-xnumberCSS scaleX, e.g. 1.5.
scale-ynumberCSS scaleY, e.g. 0.8.
skew-xnumberHorizontal skew in degrees.
skew-ynumberVertical skew in degrees.
aspect-ratiostringAspect ratio, e.g. "16/9", "1/1".
z-indexnumberExplicit CSS z-index.
visiblebooleanfalse = visibility:hidden (preserved in file, skipped in render).

Example

<rect fill="$primary" w="342" h="52" radius="12" />
<rect fill="$surface" w="320" h="80" radius="12" border="1 #E5E5EA" />
<rect fill="linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%)" w="fill" h="160" radius="16" />