<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Text/AlignmentStrategy",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4TextV17AlignmentStrategyV"
  },
  "title" : "Text.AlignmentStrategy"
}
-->

# Text.AlignmentStrategy

The way SwiftUI infers the appropriate text alignment if no value
is explicitly provided.

```
struct AlignmentStrategy
```

## Overview> Note: ``doc://com.apple.SwiftUI/documentation/SwiftUI/Text`` tightly wraps its content, so text alignment only
> affects how lines are positioned relative to each other. The text as a
> whole needs to be positioned at the view level using ``doc://com.apple.SwiftUI/documentation/SwiftUI/Alignment``.

## Topics

### Type Properties

[`static let `default`: Text.AlignmentStrategy`](/documentation/SwiftUI/Text/AlignmentStrategy/default)

The default strategy based on the context it is used in.

[`static let layoutBased: Text.AlignmentStrategy`](/documentation/SwiftUI/Text/AlignmentStrategy/layoutBased)

The alignment following the environment setting.

[`static let writingDirectionBased: Text.AlignmentStrategy`](/documentation/SwiftUI/Text/AlignmentStrategy/writingDirectionBased)

The alignment following the writing direction of the same paragraph.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)