---
title: layoutDirection
framework: swiftui
role: symbol
role_heading: Instance Property
path: swiftui/layoutsubviews/layoutdirection
---

# layoutDirection

The layout direction inherited by the container view.

## Declaration

```swift
var layoutDirection: LayoutDirection
```

## Discussion

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.
