Contents

accessibilityShowBorders

Whether the system preference for Show Borders is enabled.

Declaration

@backDeployed(before: iOS 26.1, macOS 26.1, tvOS 26.1, watchOS 26.1, visionOS 26.1)
var accessibilityShowBorders: Bool { get }

Discussion

On macOS 27 and later, the system provides a dedicated Show Borders setting in System Settings. On earlier versions of macOS, this value is true when Increased Contrast is enabled.

When this value is true, draw interactive custom controls such as buttons with clearly visible edges so they remain distinguishable at any window size:

struct BorderedButton: View {
    @Environment(\.accessibilityShowBorders) var showBorders

    var body: some View {
        Label("Archive", systemImage: "archivebox")
            .padding(8)
            .overlay {
                if showBorders {
                    RoundedRectangle(cornerRadius: 8)
                        .stroke(.secondary)
                }
            }
    }
}