Skip to main content

CamoImage

A picture with a shape, a placeholder while it loads and an error look when it fails. contentDescription describes it, or is null to hide a decorative image from screen readers; a failed image adds "could not load". aspectRatio fixes the frame's proportions.

API​

public fun CamoImage(
source: ImageSource,
contentDescription: String?,
modifier: Modifier = Modifier,
shape: ShapeRole = ShapeRole.Medium,
contentScale: ContentScale = ContentScale.Crop,
aspectRatio: Float? = null,
alignment: Alignment = Alignment.Center,
)
NameTypeDefault
sourceImageSourcerequired
contentDescriptionString?
modifierModifierModifier
shapeShapeRoleShapeRole.Medium
contentScaleContentScaleContentScale.Crop
aspectRatioFloat?null
alignmentAlignmentAlignment.Center
Design notes

Why CamoImage works this way, its states and its edge cases: contributor docs.