<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/layoutDirectionBehavior(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE23layoutDirectionBehavioryQrAA06LayouteF0OF"
  },
  "title" : "layoutDirectionBehavior(_:)"
}
-->

# layoutDirectionBehavior(_:)

Sets the behavior of this view for different layout directions.

```
nonisolated func layoutDirectionBehavior(_ behavior: LayoutDirectionBehavior) -> some View
```

## Parameters

`behavior`

A LayoutDirectionBehavior value that indicates
whether this view should mirror in a particular layout direction. By
default, views will adjust their layouts automatically in a
right-to-left context and do not need to be mirrored.

## Return Value

A view that conditionally mirrors its contents
horizontally in a given layout direction.

## Discussion

Use `layoutDirectionBehavior(_:)` when you need the system to
horizontally mirror the contents of the view when presented in a
layout direction.

To override the layout direction for a specific view, use the
[`environment(_:_:)`](/documentation/SwiftUI/View/environment(_:_:)) view modifier to explicitly override
the [`layoutDirection`](/documentation/SwiftUI/EnvironmentValues/layoutDirection) environment value for
the view.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)