RemoteText
@Composable
public fun RemoteText(
text: RemoteString,
modifier: RemoteModifier = RemoteModifier,
color: RemoteColor? = null,
fontSize: RemoteTextUnit? = null,
fontStyle: RemoteFontStyle? = null,
fontWeight: RemoteFontWeight? = null,
fontFamily: RemoteFontFamily? = null,
textAlign: RemoteTextAlign? = LocalRemoteTextConfiguration.current.textAlign,
overflow: RemoteTextOverflow = LocalRemoteTextConfiguration.current.overflow,
maxLines: Int = LocalRemoteTextConfiguration.current.maxLines,
fontVariationSettings: RemoteFontVariation.Settings? = null,
style: RemoteTextStyle = LocalRemoteTextStyle.current,
)
Displays Material Design text and provides accessibility semantics in a remote layout.
This is the Wear Material 3 counterpart to RemoteBasicText and the remote equivalent of androidx.wear.compose.material3.Text, integrating with theme colors, typography, and ambient text configuration via LocalRemoteTextConfiguration provided by surrounding Wear Material 3 components.
Commonly used properties from RemoteTextStyle are also exposed directly as parameters for convenience:
- When a styling parameter is non-
null, it overrides the corresponding property instyle. - When
null, the value fromstyleis used instead, falling back to a default value if also
unset in style.
Example of styling RemoteText with RemoteMaterialTheme.typography and theme colors:
Parameters
| text | text to display |
| modifier | the RemoteModifier applied to this text layout |
| color | text color. If null, uses RemoteTextStyle.color from style, or the ambient content color if also null in style |
| fontSize | glyph size. If null, uses RemoteTextStyle.fontSize from style, or 12.sp if also null in style |
| fontStyle | typeface slope (such as RemoteFontStyle.Italic). If null, uses RemoteTextStyle.fontStyle from style, or RemoteFontStyle.Normal if also null in style |
| fontWeight | typeface thickness (such as RemoteFontWeight.Bold). If null, uses RemoteTextStyle.fontWeight from style, or RemoteFontWeight.Normal if also null in style |
| fontFamily | font family used to render the text. If null, uses RemoteTextStyle.fontFamily from style, or the platform default typeface if also null in style |
| textAlign | horizontal alignment of the text within its container. Defaults to the ambient text configuration's alignment; if null, uses RemoteTextStyle.textAlign from style, or RemoteTextAlign.Start if also unset in style |
| overflow | how visual overflow is handled. Defaults to the ambient text configuration's overflow |
| maxLines | maximum number of visible lines (must be greater than zero). Defaults to the ambient text configuration's maxLines |
| fontVariationSettings | OpenType variable font axis settings. If null, uses RemoteTextStyle.fontVariationSettings from style, or applies no custom variation settings if also null in style |
| style | base RemoteTextStyle configuration for properties such as color, font, letter spacing, and line height. Defaults to the ambient text style provided by surrounding Wear Material 3 components |