API reference

Text Struct

Extends ViewComponentSerializable, FlexShapedComponent, Sendable
A text component displayed on the wearable.

Signature

struct Text: ViewComponentSerializable, FlexShapedComponent, Sendable

Constructors

init ( content , style , color )
Creates a text component with the given content and styling.
Signature
public init(_ content: String,  style: TextStyle,  color: TextColor)
Parameters
_ content: String  The text string to display.
style: TextStyle  Typography preset for the text. Defaults to TextStyle.body.
color: TextColor  Color preset for the text. Defaults to TextColor.primary.

Properties

alignSelf : Alignment?
Per-child cross-axis alignment override applied when this text is a child of a FlexBox.
color : TextColor
Color preset for the text.
content : String
The text string to display.
flexGrow : Float
Flex-grow factor applied when this text is a child of a FlexBox.
flexShrink : Float
Flex-shrink factor applied when this text is a child of a FlexBox.
style : TextStyle
Typography preset for the text.

Functions

alignSelf ( value )
Overrides the cross-axis alignment applied when this text is a child of a FlexBox.
Signature
public func alignSelf(_ value: Alignment) -> Text
Parameters
_ value: Alignment
Returns
Text
flexGrow ( value )
Sets the flex-grow factor applied when this text is a child of a FlexBox.
Signature
public func flexGrow(_ value: Float) -> Text
Parameters
_ value: Float
Returns
Text
flexShrink ( value )
Sets the flex-shrink factor applied when this text is a child of a FlexBox.
Signature
public func flexShrink(_ value: Float) -> Text
Parameters
_ value: Float
Returns
Text