Avatar

fun Avatar(imageUrl: String, initials: String, modifier: Modifier = Modifier, shape: Shape = ChatTheme.shapes.avatar, textStyle: TextStyle = ChatTheme.typography.title3Bold, placeholderPainter: Painter? = null, contentDescription: String? = null, initialsAvatarOffset: DpOffset = DpOffset(0.dp, 0.dp), onClick: () -> Unit? = null)

An avatar that renders an image from the provided image URL. In case the image URL was empty or there was an error loading the image, it falls back to the initials avatar.

Parameters

imageUrl

The URL of the image to load.

initials

The fallback text.

modifier

Modifier for styling.

shape

The shape of the avatar.

textStyle

The text style of the initials text.

placeholderPainter

The placeholder to render while loading is in progress.

contentDescription

Description of the image.

initialsAvatarOffset

The initials offset to apply to the avatar.

onClick

OnClick action, that can be nullable.