RemoteBasicIcon

Functions summary

Unit
@RemoteComposable
@Composable
RemoteBasicIcon(
    imageVector: RemoteImageVector,
    contentDescription: RemoteString?,
    modifier: RemoteModifier,
    tint: RemoteColor
)

Displays a vector icon from a RemoteImageVector in a remote layout.

Functions

@RemoteComposable
@Composable
fun RemoteBasicIcon(
    imageVector: RemoteImageVector,
    contentDescription: RemoteString?,
    modifier: RemoteModifier = RemoteModifier,
    tint: RemoteColor = 0xFFFFFFFF.toInt().rc
): Unit

Displays a vector icon from a RemoteImageVector in a remote layout.

Sizes the icon to imageVector's intrinsic dimensions, or 24.dp when unspecified. Unlike Material icon components (such as androidx.wear.compose.remote.material3.RemoteIcon) that read a theme content color, RemoteBasicIcon is a design-system-agnostic building block that defaults tint to opaque white (0xFFFFFFFF).

Provide a localized contentDescription (for example, via stringResource) whenever the icon conveys meaning or represents an action. Pass null only for purely decorative icons, which omits the accessibility content description so accessibility services ignore it.

Example of a tinted RemoteBasicIcon:

import androidx.compose.remote.creation.compose.capture.RemoteImageVector
import androidx.compose.remote.creation.compose.capture.path
import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.size
import androidx.compose.remote.creation.compose.shaders.RemoteBrush
import androidx.compose.remote.creation.compose.shaders.solidColor
import androidx.compose.remote.creation.compose.state.RemoteColor
import androidx.compose.remote.creation.compose.state.rc
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rf
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.remote.foundation.icon.RemoteBasicIcon
import androidx.compose.ui.graphics.Color

val remoteImageVector =
    RemoteImageVector.Builder(
            viewportWidth = 24.0f.rf,
            viewportHeight = 24.0f.rf,
            tintColor = RemoteColor(Color.White),
            name = "Sample Icon",
        )
        .path(fill = RemoteBrush.solidColor(Color.White.rc)) {
            moveTo(4.0f.rf, 4.0f.rf)
            lineTo(20.0f.rf, 4.0f.rf)
            lineTo(20.0f.rf, 20.0f.rf)
            lineTo(4.0f.rf, 20.0f.rf)
            close()
        }
        .build()

RemoteBasicIcon(
    imageVector = remoteImageVector,
    contentDescription = "Sample Icon".rs,
    modifier = RemoteModifier.size(24.rdp),
    tint = Color.Red.rc,
)
Parameters
imageVector: RemoteImageVector

the RemoteImageVector to draw inside this icon

contentDescription: RemoteString?

localized text used by accessibility services to describe this icon, or null if the icon is purely decorative and has no accessibility description

modifier: RemoteModifier = RemoteModifier

the RemoteModifier applied to this icon

tint: RemoteColor = 0xFFFFFFFF.toInt().rc

color applied to imageVector using a color filter with the vector's tint blend mode (androidx.compose.remote.creation.compose.state.RemoteBlendMode.SrcIn by default, which replaces the icon's RGB colors with tint while preserving alpha rather than multiplying RGBA). Defaults to opaque white (0xFFFFFFFF)