With accessibilityRepresentation(representation:), you can create a custom component and it can be perceived by assistive technologies as the view you pass as representation. No need to manually configure accessibility attributes.

A budgeting planner app with custom sliders to configure categories like food and entertainment. All it takes to make it accessible is to use the .accessibilityRepresentation modifier and pass a native Slider configured accordingly. Example and code from “SwiftUI Accessibility: Beyond the basics” from WWDC 21.

It is one of the most interesting additions to SwiftUI to help you develop accessible UI components. If your custom component behaves similarly to a native one, this is the way to go.

https://developer.apple.com/documentation/swiftui/view/accessibilityrepresentation(representation:)