<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextTab/init(textAlignment:location:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextTab(im)initWithTextAlignment:location:options:"
  },
  "title" : "init(textAlignment:location:options:)"
}
-->

# init(textAlignment:location:options:)

Initializes a text tab with the specified text alignment, location, and options.

```
init(textAlignment alignment: NSTextAlignment, location loc: CGFloat, options: [NSTextTab.OptionKey : Any] = [:])
```

## Parameters

`alignment`

The alignment of the text.

`loc`

The position of the text tab on the ruler, relative to the back margin.

`options`

Options to apply to the text tab.

## Return Value

An initialized text tab.

## Discussion

The text alignment is used to determine the position of text inside the tab column. See [`NSParagraphStyle.TextTabType`](/documentation/AppKit/NSParagraphStyle/TextTabType) for a mapping between alignments and tab stop types

---

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)