← Back to Material Compose
Icon
Overview
Code Examples
Video
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.
@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
@NonRestartableComposable
fun Icon(
imageVector: ImageVector,
contentDescription: String?,
modifier: Modifier = Modifier,
tint: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
)
Parameters
Name | Description |
---|---|
imageVector | ImageVector to draw inside this Icon |
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 |
modifier | optional Modifier for this Icon |
tint | tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applie |
Icon
@Composable
@NonRestartableComposable
fun Icon(
bitmap: ImageBitmap,
contentDescription: String?,
modifier: Modifier = Modifier,
tint: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
)
Parameters
Name | Description |
---|---|
bitmap | ImageBitmap to draw inside this Icon |
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 |
modifier | optional Modifier for this Icon |
tint | tint 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
Name | Description |
---|---|
painter | Painter to draw inside this Icon |
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 |
modifier | optional Modifier for this Icon |
tint | tint to be applied to painter. If Color.Unspecified is provided, then no tint is applie |