by @alexstyl
✉️ Leave your feedback

← Back to Wear Material 3

Icon

Component
in
Wear Material 3
. Since 1.0.0-alpha01

Overview

Examples

Community Notes

Icon component that draws imageVector using tint, defaulting to LocalContentColor. For a clickable icon, see Button.

@param imageVector ImageVector to draw inside this Icon @param contentDescription Text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar @param modifier Optional Modifier for this Icon @param tint Tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied

Overloads

Icon

@Composable
fun Icon(
    imageVector: ImageVector,
    contentDescription: String?,
    modifier: Modifier = Modifier,
    tint: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
)

Parameters

NameDescription
imageVectorImageVector to draw inside this Icon
contentDescriptionText used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar
modifierOptional Modifier for this Icon
tintTint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applie

Icon

@Composable
fun Icon(
    bitmap: ImageBitmap,
    contentDescription: String?,
    modifier: Modifier = Modifier,
    tint: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
)

Parameters

NameDescription
bitmapImageBitmap to draw inside this Icon
contentDescriptionText used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar
modifierOptional Modifier for this Icon
tintTint to be applied to bitmap. If Color.Unspecified is provided, then no tint is applie

Icon

@Composable
fun Icon(
    painter: Painter,
    contentDescription: String?,
    modifier: Modifier = Modifier,
    tint: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
)

Parameters

NameDescription
painterPainter to draw inside this Icon
contentDescriptionText used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar
modifierOptional Modifier for this Icon
tintTint to be applied to painter. If Color.Unspecified is provided, then no tint is applie
Previous ComponentHorizontalPageIndicator
Next ComponentIconButton