<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/LayoutSubviews/layoutDirection",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI14LayoutSubviewsV15layoutDirectionAA0cF0Ovp"
  },
  "title" : "layoutDirection"
}
-->

# layoutDirection

The layout direction inherited by the container view.

```
var layoutDirection: LayoutDirection
```

## Discussion

SwiftUI supports both left-to-right and right-to-left directions.
Read this property within a custom layout container
to find out which environment the container is in.

In most cases, you don’t need to take any action based on this
value. SwiftUI horizontally flips the x position of each view within its
parent when the mode switches, so layout calculations automatically
produce the desired effect for both directions.

---

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)