Sugar for a childless <frame>. Signals decorative intent — no layout children. w and h are required.
rect
tagrectangleSugar 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.
| Attr | Type | Description |
|---|---|---|
name | string | |
x | number | |
y | number | |
w required | number | '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 required | number | '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. |
fill | fill | |
fill-style | string | |
effect-style | string | |
radius | number | string | |
corner-smoothing | number | |
border | string | |
border-color | color | token | |
border-width | number | |
border-style | solid dashed dotted | |
border-align | center inside outside | |
shadow | string | |
fill-rule | nonzero evenodd |
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" />