The SwiftUI TextEditor view does not currently support rich text. You will have to wrap either UITextView (iOS) or NSTextView (Mac) using the UIViewRepresentable or NSViewRepresentable protocols. Search for UIViewRepresentable in a search engine to find articles on how to do this. You may also find the following article helpful even though it doesn't deal specifically with rich text:
swiftdevjournal.com/using-text-views-in-a-swiftui-app/
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: