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

← Back to Foundation

Icon

Component
in
Foundation
. Since 0.1.0-dev15

Overview

Code Examples

Video

Icon component that draws imageVector using tint, defaulting to AmbientContentColor.

@param imageVector ImageVector to draw inside this Icon @param modifier optional Modifier for this Icon @param tint tint to be applied to asset. If Color.Unspecified is provided, then no tint is applied

Overloads

Icon

@Deprecated(
    "Icon has been moved into the Material library: androidx.compose.material.Icon",
    replaceWith = ReplaceWith("Icon(asset)", "androidx.compose.material.Icon")
)
@Composable
fun Icon(
    imageVector: ImageVector,
    modifier: Modifier = Modifier,
    tint: Color = AmbientContentColor.current
)

Parameters

NameDescription
imageVectorImageVector to draw inside this Icon
modifieroptional Modifier for this Icon
tinttint to be applied to asset. If Color.Unspecified is provided, then no tint is applie

Icon

@Deprecated(
    "Icon has been moved into the Material library: androidx.compose.material.Icon",
    replaceWith = ReplaceWith("Icon(asset)", "androidx.compose.material.Icon")
)
@Composable
fun Icon(
    bitmap: ImageBitmap,
    modifier: Modifier = Modifier,
    tint: Color = AmbientContentColor.current
)

Parameters

NameDescription
bitmapImageBitmap to draw inside this Icon
modifieroptional Modifier for this Icon
tinttint to be applied to bitmap. If Color.Unspecified is provided, then no tint is applie

Icon

@Deprecated(
    "Icon has been moved into the Material library: androidx.compose.material.Icon",
    replaceWith = ReplaceWith("Icon(asset)", "androidx.compose.material.Icon")
)
@Composable
fun Icon(
    painter: Painter,
    modifier: Modifier = Modifier,
    tint: Color = AmbientContentColor.current
)

Parameters

NameDescription
painterPainter to draw inside this Icon
modifieroptional Modifier for this Icon
tinttint to be applied to painter. If Color.Unspecified is provided, then no tint is applie