You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/docs/group.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ It can apply the following operations to its children:
21
21
| clip? |`RectOrRRectOrPath`| Rectangle, rounded rectangle, or Path to use to clip the children. |
22
22
| invertClip? |`boolean`| Invert the clipping region: parts outside the clipping region will be shown and, inside will be hidden. |
23
23
| layer? |`RefObject<Paint>`| Draws the children as a bitmap and applies the effects provided by the paint. |
24
+
| zIndex? |`number`| Overrides the drawing order of the children. A child with a higher zIndex will be drawn on top of a child with a lower zIndex. The zIndex is local to the group. The default zIndex is 0. Negative values are supported. |
24
25
25
26
The following three components are not being affected by the group properties. To apply paint effects on these component, you need to use [layer effects](#layer-effects).
26
27
In each component reference, we also document how to apply paint effects on them.
The `zIndex` property allows you to control the drawing order of elements. It can be applied to a group or a drawing command. An element with a higher `zIndex` will be drawn on top of a sibling element with a lower `zIndex`. The default `zIndex` is 0, and negative values are supported.
296
+
297
+
The `zIndex` is scoped to the parent [`<Group />`](/docs/group). This means that the `zIndex` of an element only affects its drawing order relative to its siblings within the same group. A group's `zIndex` will determine its order among its sibling groups.
298
+
299
+
### Example
300
+
301
+
In the example below, the cyan circle (`zIndex={2}`) is drawn on top, followed by the magenta circle (`zIndex={1}`), and finally the yellow circle (`zIndex={0}`).
0 commit comments