State of Compose 2023 results are in! Click here to learn more

← Back to Compose UI

Group

Component
in
Compose UI
. Since 1.4.0

Overview

Code Examples

Defines a group of Paths and other Groups inside a VectorPainter. This is not a regular UI composable, it can only be called inside composables called from the content parameter to rememberVectorPainter.

@param name Optional name of the group used when describing the vector as a string. @param rotation The rotation of the group around the Z axis, in degrees. @param pivotX The horizontal pivot point used for rotation, in pixels. @param pivotY The vertical pivot point used for rotation, in pixels. @param scaleX Factor to scale the group by horizontally. @param scaleY Factor to scale the group by vertically. @param translationX Horizontal offset of the group, in pixels. @param translationY Vertical offset of the group, in pixels. @param clipPathData A list of PathNodes that define how to clip the group. Empty by default. @param content A composable that defines the contents of the group.

Overloads

Group

@Composable
@VectorComposable
fun Group(
    name: String = DefaultGroupName,
    rotation: Float = DefaultRotation,
    pivotX: Float = DefaultPivotX,
    pivotY: Float = DefaultPivotY,
    scaleX: Float = DefaultScaleX,
    scaleY: Float = DefaultScaleY,
    translationX: Float = DefaultTranslationX,
    translationY: Float = DefaultTranslationY,
    clipPathData: List<PathNode> = EmptyPath,
    content: @Composable @VectorComposable () -> Unit
)

Parameters

NameDescription
nameOptional name of the group used when describing the vector as a string.
rotationThe rotation of the group around the Z axis, in degrees.
pivotXThe horizontal pivot point used for rotation, in pixels.
pivotYThe vertical pivot point used for rotation, in pixels.
scaleXFactor to scale the group by horizontally.
scaleYFactor to scale the group by vertically.
translationXHorizontal offset of the group, in pixels.
translationYVertical offset of the group, in pixels.
clipPathDataA list of PathNodes that define how to clip the group. Empty by default.
contentA composable that defines the contents of the group