{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

IconKt

public final class IconKt


Summary

Public methods

static final void
@Composable
Icon(
    @NonNull ImageBitmap bitmap,
    String contentDescription,
    @NonNull Modifier modifier,
    @NonNull Color tint
)

A Material Design icon component that draws bitmap using tint, with a default value of LocalContentColor.

static final void
@Composable
Icon(
    @NonNull ImageVector imageVector,
    String contentDescription,
    @NonNull Modifier modifier,
    @NonNull Color tint
)

A Material Design icon component that draws imageVector using tint, with a default value of LocalContentColor.

static final void
@Composable
Icon(
    @NonNull Painter painter,
    String contentDescription,
    @NonNull Modifier modifier,
    @NonNull Color tint
)

A Material Design icon component that draws painter using tint, with a default value of LocalContentColor.

Public methods

Icon

@Composable
public static final void Icon(
    @NonNull ImageBitmap bitmap,
    String contentDescription,
    @NonNull Modifier modifier,
    @NonNull Color tint
)

A Material Design icon component that draws bitmap using tint, with a default value of LocalContentColor. If bitmap has no intrinsic size, this component will use the recommended default size. Icon is an opinionated component designed to be used with single-color icons so that they can be tinted correctly for the component they are placed in. For multicolored icons and icons that should not be tinted, use Color.Unspecified for tint. For generic images that should not be tinted, and do not follow the recommended icon size, use the generic androidx.compose.foundation.Image instead. For a clickable icon, see IconButton.

To learn more about icons, see Material Design icons

Parameters
@NonNull ImageBitmap bitmap

ImageBitmap to draw inside this icon

String 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

@NonNull Modifier modifier

the Modifier to be applied to this icon

@NonNull Color tint

tint to be applied to bitmap. If Color.Unspecified is provided, then no tint is applied.

Icon

@Composable
public static final void Icon(
    @NonNull ImageVector imageVector,
    String contentDescription,
    @NonNull Modifier modifier,
    @NonNull Color tint
)

A Material Design icon component that draws imageVector using tint, with a default value of LocalContentColor. If imageVector has no intrinsic size, this component will use the recommended default size. Icon is an opinionated component designed to be used with single-color icons so that they can be tinted correctly for the component they are placed in. For multicolored icons and icons that should not be tinted, use Color.Unspecified for tint. For generic images that should not be tinted, and do not follow the recommended icon size, use the generic androidx.compose.foundation.Image instead. For a clickable icon, see IconButton.

To learn more about icons, see Material Design icons

Parameters
@NonNull ImageVector imageVector

ImageVector to draw inside this icon

String 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

@NonNull Modifier modifier

the Modifier to be applied to this icon

@NonNull Color tint

tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied.

Icon

@Composable
public static final void Icon(
    @NonNull Painter painter,
    String contentDescription,
    @NonNull Modifier modifier,
    @NonNull Color tint
)

A Material Design icon component that draws painter using tint, with a default value of LocalContentColor. If painter has no intrinsic size, this component will use the recommended default size. Icon is an opinionated component designed to be used with single-color icons so that they can be tinted correctly for the component they are placed in. For multicolored icons and icons that should not be tinted, use Color.Unspecified for tint. For generic images that should not be tinted, and do not follow the recommended icon size, use the generic androidx.compose.foundation.Image instead. For a clickable icon, see IconButton.

To learn more about icons, see Material Design icons

Parameters
@NonNull Painter painter

Painter to draw inside this icon

String 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

@NonNull Modifier modifier

the Modifier to be applied to this icon

@NonNull Color tint

tint to be applied to painter. If Color.Unspecified is provided, then no tint is applied.