macOS right alignment of labels with Swift UI

Is there an elegant way to produce macOS conforming label/text field alignment with SwiftUI?

Once upon a time the Human Interface Guidelines provided diagrams illustrating how Labels should be right aligned on macOS. Big Sur's System Preferences > General still presents this best practice with the colons right aligned (the design guidelines seem to no longer mention this) and the text fields left aligned.

Whilst we will use a combination of VStacks and HStacks to layout an interface in this manner, it isn't clear how you currently specify a modifier to align the contents of multiple HStacks so that each has all the text labels right aligned, all the Text Fields left aligned (and the same width or opt in to do so) and also maintain a constant and standard distance between every Label and TextField.

To add, one might think that in SwiftUI parlance that we would drop the colon (:) from the Text definition and that SwiftUI would automagically put that in for us. Also not put it in on iOS. Dropping the colon from the Text string would help accessibility - one less character to convey.

HorizontalAlignment didn't seem to offer this.

A naive form layout for macOS doesn't produce a HIG-happy visual design.




Howdy, we really appreciate your thoughts here! If you could file this as feedback and encapsulate your expectations (especially the trailing colon in labels for improving multi-platform and accessibility) that would be seriously helpful!
http://feedbackassistant.apple.com/

If you find any other API confusing or not allowing you to do what you want, we'd love to hear how you want to use it in your app as well.
macOS right alignment of labels with Swift UI
 
 
Q