To style a button in SwiftUI, according to my understanding, you extend ButtonStyle and implement func makeBody(configuration: Self.Configuration) -> s
Another option would be to pass a disabled Boolean value to your ButtonStyle, and then use the allowsHitTesting modifier on the label to effectively disable the button:
struct MyButtonStyle: ButtonStyle {
let disabled: Bool
func makeBody(configuration: Self.Configuration) -> some View {
configuration
.label
.allowsHitTesting(!disabled)
}
}