<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Text/tracking(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4TextV8trackingyAC14CoreFoundation7CGFloatVF"
  },
  "title" : "tracking(_:)"
}
-->

# tracking(_:)

Sets the tracking for the text.

```
nonisolated func tracking(_ tracking: CGFloat) -> Text
```

## Parameters

`tracking`

The amount of additional space, in points, that
the view should add to each character cluster after layout. Value of `0`
sets the tracking to the system default value.

## Return Value

Text with the specified amount of tracking.

## Discussion

Tracking adds space, measured in points, between the characters in the
text view. A positive value increases the spacing between characters,
while a negative value brings the characters closer together.

```
VStack(alignment: .leading) {
    Text("ABCDEF").tracking(-3)
    Text("ABCDEF")
    Text("ABCDEF").tracking(3)
}
```

The code above uses an unusually large amount of tracking to make it
easy to see the effect.

![Three text views showing character groups with progressively](images/com.apple.SwiftUI/SwiftUI-Text-tracking@2x.png)

The effect of tracking resembles that of the [`kerning(_:)`](/documentation/SwiftUI/Text/kerning(_:))
modifier, but adds or removes trailing whitespace, rather than changing
character offsets. Also, using any nonzero amount of tracking disables
nonessential ligatures, whereas kerning attempts to maintain ligatures.

> Important: If you add both the ``doc://com.apple.SwiftUI/documentation/SwiftUI/Text/tracking(_:)`` and
> ``doc://com.apple.SwiftUI/documentation/SwiftUI/Text/kerning(_:)`` modifiers to a view, the view applies the
> tracking and ignores the kerning.

---

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)