.bold()
The .bold()
modifier method applies a bold font weight to text.
Syntax
Text("I will be bold text!")
.bold()
The .bold()
modifier takes no parameters and returns a Text
view with bold text.
Example
The following example creates bolded text:
import SwiftUIstruct BoldView: View {var body: some View {Text("I'm Bold Text!").bold()}}
In the above example, the .bold()
modifier is applied on the Text
view, which applies a bold style to all the text within the Text
view.
This will display the following:
All contributors
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.