---
title: LayoutDirection
framework: swiftui
role: symbol
role_heading: Enumeration
path: swiftui/layoutdirection
---

# LayoutDirection

A direction in which SwiftUI can lay out content.

## Declaration

```swift
enum LayoutDirection
```

## Overview

Overview SwiftUI supports both left-to-right and right-to-left directions for laying out content to support different languages and locales. The system sets the value based on the user’s locale, but you can also use the environment(_:_:) modifier to override the direction for a view and its child views: MyView()     .environment(\.layoutDirection, .rightToLeft) You can also read the layoutDirection environment value to find out which direction applies to a particular environment. However, in many 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, so layout calculations automatically produce the desired effect for both modes without any changes.

## Topics

### Getting layout directions

- [LayoutDirection.leftToRight](swiftui/layoutdirection/lefttoright.md)
- [LayoutDirection.rightToLeft](swiftui/layoutdirection/righttoleft.md)

### Creating a layout direction

- [init(_:)](swiftui/layoutdirection/init(_:).md)

## Relationships

### Conforms To

- [CaseIterable](swift/caseiterable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Setting a layout direction

- [layoutDirectionBehavior(_:)](swiftui/view/layoutdirectionbehavior(_:).md)
- [LayoutDirectionBehavior](swiftui/layoutdirectionbehavior.md)
- [layoutDirection](swiftui/environmentvalues/layoutdirection.md)
- [LayoutRotationUnaryLayout](swiftui/layoutrotationunarylayout.md)
