FontIcon

fun FontIcon(iconName: String, contentDescription: String?, modifier: Modifier = Modifier, tint: Color = LocalIconTintProvider.current?.current ?: LocalIconTint.current, weight: FontWeight = LocalIconWeight.current, iconFont: IconFont = LocalIconFont.current)(source)

A component that draws the icon iconName using iconFont (with a default value of LocalIconFont. The icon will be size × size dp, and will be tinted with tint. If iconFont is a variable font, weight will applied as a variation setting, or else the font with the nearest weight will be picked.

Parameters

iconName

the icon name (can be a single character or a string)

contentDescription

the 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 org.jetbrains.compose.resources.stringResource or similar

modifier

the Modifier to be applied to this icon

tint

the tint to be applied to this icon, by default the value of LocalIconTintProvider, or LocalIconTint if null

weight

the font weight of the icon, by default LocalIconWeight

iconFont

the icon font used to draw this icon, by default LocalIconFont


fun FontIcon(icon: Char, contentDescription: String?, modifier: Modifier = Modifier, tint: Color = LocalIconTintProvider.current?.current ?: LocalIconTint.current, weight: FontWeight = LocalIconWeight.current, iconFont: IconFont = LocalIconFont.current)(source)

A component that draws the icon icon using iconFont (with a default value of LocalIconFont. The icon will be size × size dp, and will be tinted with tint. If iconFont is a variable font, weight will applied as a variation setting, or else the font with the nearest weight will be picked.

Parameters

icon

the icon Unicode character

contentDescription

the 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 org.jetbrains.compose.resources.stringResource or similar

modifier

the Modifier to be applied to this icon

tint

the tint to be applied to this icon, by default the value of LocalIconTintProvider, or LocalIconTint if null

weight

the font weight of the icon, by default LocalIconWeight

iconFont

the icon font used to draw this icon, by default LocalIconFont