RepeatedLayout
Periodically duplicates a pattern in the cropping window, suitable for continuously moving scales and compasses. period sets the repeat interval, value and anchor determine where the current value is aligned.
Example
function main() {
return (
<RepeatedLayout axis="horizontal" period={120} value={76} anchor={0.5}>
<Text width={120}>N</Text>
</RepeatedLayout>
);
}
Usage
- children define one tile and period defines repetition spacing. value aligns with anchor: increasing value moves tiles the opposite way; offset adds a point displacement. both repeats in two directions, independently configurable with {x,y}. The viewport always clips.
- Layout reserves space before x/y and transform are applied. Moving a child right by 20 points does not push its siblings away; use spacing or Spacer to change gaps. Rotation and scaling affect the completed View.
Properties
children?ViewContentChild drawing content.
axis?"horizontal" | "vertical" | "both"Repeat horizontally, vertically or on both axes. both produces a grid of copies.
"horizontal"period?RepeatAxisValueDistance between repeated copies in points; use x/y values for independent axis spacing.
360value?RepeatAxisValueContent coordinate placed at the anchor. Increasing it moves copies in the opposite direction; it is not a speed.
$data.current.heading?.direction ?? 0anchor?RepeatAxisValuePosition within the viewport: 0 is the start, 0.5 the middle, 1 the end.
0.5offset?RepeatAxisValueAdditional offset in points after aligning the value to the anchor.
0alignment?"topLeading" | "top" | "topTrailing" | "leading" | "center" | "trailing" | "bottomLeading" | "bottom" | "bottomTrailing"Alignment of overlaid children within the container, using nine edge/center positions.
"topLeading"Common properties
width?number | "auto" | "fill"Width in points, auto sizing or parent fill.
100height?number | "auto" | "fill"Height in points, auto sizing or parent fill.
80padding?numberContent padding in points.
0x?numberVisual offset in points: x moves right, y moves down. Does not change layout space.
0y?numberVisual offset in points: x moves right, y moves down. Does not change layout space.
0transform?ViewTransformTransform the whole View without changing layout. Translation uses points; rotation/skew use degrees; scale 1 is unchanged; anchors use 0–1.
{rotation: 0}background?PaintBackground paint; accepts a color or gradient. Use clear for transparency.
"clear"opacity?numberOpacity of the whole View: 0 is transparent, 1 is opaque.
1cornerRadius?numberCorner radius in points.
0clip?"rectangle" | "ellipse"Clipping shape: rectangle or ellipse. Material also accepts false to disable clipping.
"rectangle"mask?View | nullAlpha mask View. Centered without affecting layout; null disables masking.
<Circle width="fill" height="fill" background="white"/>zIndex?numberDrawing order among siblings; larger values appear in front.
0blur?numberBlur radius in points; 0 disables blur.
4innerShadow?DrawingEffectEffect color, opacity, blur radius and x/y offset. Distances are in points.
{color: HDR("black"), opacity: 0.5, radius: 4, x: 0, y: 2}glow?DrawingEffectEffect color, opacity, blur radius and x/y offset. Distances are in points.
{color: HDR("cyan"), radius: 8, opacity: 0.8}shadowColor?ColorColor of the outer shadow.
HDR("black")shadowOpacity?numberOuter shadow opacity from 0 to 1; 0 hides it.
0shadowRadius?numberOuter shadow blur radius in points.
4shadowX?numberOuter shadow offset in points: x right, y down.
0shadowY?numberOuter shadow offset in points: x right, y down.
2animations?Animation[]Animate a supported property when it changes. duration/delay use seconds; from/to set endpoints; repeat and autoreverse control repetition; wrap sets a periodic range.
[{property: "opacity", duration: 0.25, curve: "easeInOut"}]key?string | numberStable identity among siblings.
Practical example
function main() {
return (
<RepeatedLayout
width={240}
height={140}
axis="both"
period={{ x: 80, y: 50 }}
value={{ x: 40, y: 25 }}
anchor={{ x: 0.5, y: 0.5 }}
alignment="center"
>
<Symbol name="plus" fontSize={20} color={$env.accent} />
</RepeatedLayout>
);
}
Animation
widthheightpaddingxyopacitybackgroundcornerRadiusblurshadowColorshadowOpacityshadowRadiusshadowXshadowYperiodvalueanchoroffsettransform.translateXtransform.translateYtransform.scaleXtransform.scaleYtransform.rotationtransform.skewXtransform.skewYtransform.anchorXtransform.anchorYperiod.xperiod.yvalue.xvalue.yanchor.xanchor.yoffset.xoffset.yWhen omitted
The table lists omission behavior verified against implementation. Property examples are copyable syntax, not defaults. Pass explicit values for a fixed result; contextual dimensions and theme colors are not fixed constants.