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

← Back to Wear Material Core

Icon

Component
in
Wear Material Core
. Since 1.2.0-rc01

Overview

Code Examples

Icon component that draws a painter using tint. TODO:// Add link to Chip for a clickable icon

@param painter Painter 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 painter. If Color.Unspecified is provided, then no tint is applied

Overloads

Icon

@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Composable
fun Icon(
    painter: Painter,
    contentDescription: String?,
    modifier: Modifier,
    tint: Color
)

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