Contents

labelStyle(_:)

Sets the style for labels within this view.

Declaration

nonisolated func labelStyle<S>(_ style: S) -> some View where S : LabelStyle

Discussion

Use this modifier to set a specific style for all labels within a view:

VStack {
    Label("Fire", systemImage: "flame.fill")
    Label("Lightning", systemImage: "bolt.fill")
}
.labelStyle(MyCustomLabelStyle())

See Also

Displaying text