RadialLayout
Distribute scales, numbers, or symbols around a circle. radius controls the distance from the center to the layout center of View, and startAngle and sweepAngle control the distribution range.
Example
function main() {
return (
<RadialLayout
radius={70}
startAngle={-90}
sweepAngle={270}
includeEnd={true}
>
{[0, 60, 120, 180].map((value) => (
<Text key={value}>{value}</Text>
))}
</RadialLayout>
);
}
Usage
- Radii position child centers, not the outer container edge. includeEnd=false divides the sweep into n parts; true uses n−1 and suits partial-scale endpoints. Including a full-circle endpoint overlaps first and last children. childRotation controls orientation.
- Angles use degrees: 0 right, 90 down, positive sweeps clockwise. startAngle wraps modulo 360; sweepAngle preserves direction and clamps to −360…360. Zero draws nothing; ±360 closes a full turn. startAngle transitions may use wrap:360; sweepAngle cannot.
- Use stable data identifiers as array keys so updates and animations retain View identity. An array index is unsuitable as permanent identity when items can reorder.
Properties
children?ViewContentChild drawing content.
radius?numberLayout radius in points. radius applies to both axes; radiusX/radiusY override each axis. Negative radii become 0.
80radiusX?numberLayout radius in points. radius applies to both axes; radiusX/radiusY override each axis. Negative radii become 0.
80radiusY?numberLayout radius in points. radius applies to both axes; radiusX/radiusY override each axis. Negative radii become 0.
80startAngle?numberStart angle in degrees, wrapped modulo 360 when sampled.
-90sweepAngle?numberSweep in degrees, clamped to -360…360 when sampled. Positive is clockwise; wrap is unsupported.
360includeEnd?booleanInclude the sweep endpoint in child placement. Leave false for a full circle to avoid overlapping first and last items.
falsechildRotation?"none" | "radial" | "tangent"Child rotation: none preserves orientation, radial follows the radius, tangent adds 90 degrees.
"none"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.
0clipped?booleanClip drawing that extends beyond the View bounds.
falseclip?"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?RadialLayoutAnimation[]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 (
<RadialLayout
width={200}
height={200}
radius={76}
startAngle={-135}
sweepAngle={270}
includeEnd={true}
>
{[0, 50, 100, 150, 200].map((value) => (
<Text key={value} fontSize={14}>
{value}
</Text>
))}
</RadialLayout>
);
}
Animation
widthheightpaddingxyopacitybackgroundcornerRadiusblurshadowColorshadowOpacityshadowRadiusshadowXshadowYradiusradiusXradiusYstartAnglesweepAngletransform.translateXtransform.translateYtransform.scaleXtransform.scaleYtransform.rotationtransform.skewXtransform.skewYtransform.anchorXtransform.anchorYWhen 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.
| Properties | When omitted |
|---|---|
radius | 80 |
startAngle | -90 |
sweepAngle | 360 |
includeEnd | false |
childRotation | "none" |