---
title: "tracking(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/text/tracking(_:)"
---

# tracking(_:)

Sets the tracking for the text.

## Declaration

```swift
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

Return Value Text with the specified amount of tracking.

## Discussion

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.

The effect of tracking resembles that of the 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 tracking(_:) and kerning(_:) modifiers to a view, the view applies the tracking and ignores the kerning.

## See Also

### Styling the view’s text

- [foregroundStyle(_:)](swiftui/text/foregroundstyle(_:).md)
- [bold()](swiftui/text/bold().md)
- [bold(_:)](swiftui/text/bold(_:).md)
- [italic()](swiftui/text/italic().md)
- [italic(_:)](swiftui/text/italic(_:).md)
- [strikethrough(_:color:)](swiftui/text/strikethrough(_:color:).md)
- [strikethrough(_:pattern:color:)](swiftui/text/strikethrough(_:pattern:color:).md)
- [underline(_:color:)](swiftui/text/underline(_:color:).md)
- [underline(_:pattern:color:)](swiftui/text/underline(_:pattern:color:).md)
- [monospaced(_:)](swiftui/text/monospaced(_:).md)
- [monospacedDigit()](swiftui/text/monospaceddigit().md)
- [kerning(_:)](swiftui/text/kerning(_:).md)
- [baselineOffset(_:)](swiftui/text/baselineoffset(_:).md)
- [Text.Case](swiftui/text/case.md)
- [Text.DateStyle](swiftui/text/datestyle.md)
