<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSParagraphStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSParagraphStyle"
  },
  "title" : "NSParagraphStyle"
}
-->

# NSParagraphStyle

The paragraph or ruler attributes for an attributed string.

```
class NSParagraphStyle
```

## Overview

An [`NSParagraphStyle`](/documentation/AppKit/NSParagraphStyle) object stores formatting information for a paragraph of text. The formatting information includes the amount of space between lines, indentations for lines of text, line heights, tab-stop positions, and more. Apply paragraph styles to the text of an attributed string by adding the <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key/paragraphStyle> attribute and setting its value to an instance of this class. The text-rendering system uses the paragraph style information in an attributed string to lay out and render the text.

The [`NSParagraphStyle`](/documentation/AppKit/NSParagraphStyle) class manages an immutable set of style information, but you can create an [`NSMutableParagraphStyle`](/documentation/AppKit/NSMutableParagraphStyle) when you want to modify the style information before applying it to your text.

## Topics

### Creating a paragraph style

[`defaultParagraphStyle`](/documentation/AppKit/NSParagraphStyle/default)

The default paragraph style.

[`init(coder:)`](/documentation/AppKit/NSParagraphStyle/init(coder:))

### Accessing style information

[`alignment`](/documentation/AppKit/NSParagraphStyle/alignment)

The text alignment of the paragraph.

[`NSTextAlignment`](/documentation/AppKit/NSTextAlignment)

Constants that specify text alignment.

[`firstLineHeadIndent`](/documentation/AppKit/NSParagraphStyle/firstLineHeadIndent)

The indentation of the first line of the paragraph.

[`headIndent`](/documentation/AppKit/NSParagraphStyle/headIndent)

The indentation of the paragraph’s lines other than the first.

[`tailIndent`](/documentation/AppKit/NSParagraphStyle/tailIndent)

The trailing indentation of the paragraph.

[`lineHeightMultiple`](/documentation/AppKit/NSParagraphStyle/lineHeightMultiple)

The line height multiple.

[`maximumLineHeight`](/documentation/AppKit/NSParagraphStyle/maximumLineHeight)

The paragraph’s maximum line height.

[`minimumLineHeight`](/documentation/AppKit/NSParagraphStyle/minimumLineHeight)

The paragraph’s minimum line height.

[`lineSpacing`](/documentation/AppKit/NSParagraphStyle/lineSpacing)

The distance in points between the bottom of one line fragment and the top of the next.

[`paragraphSpacing`](/documentation/AppKit/NSParagraphStyle/paragraphSpacing)

Distance between the bottom of this paragraph and top of next.

[`paragraphSpacingBefore`](/documentation/AppKit/NSParagraphStyle/paragraphSpacingBefore)

The distance between the paragraph’s top and the beginning of its text content.

### Accessing tab information

[`tabStops`](/documentation/AppKit/NSParagraphStyle/tabStops)

The text tab objects that represent the paragraph’s tab stops.

[`TextTabType`](/documentation/AppKit/NSParagraphStyle/TextTabType)

Constants that specify the type of tab stop.

[`defaultTabInterval`](/documentation/AppKit/NSParagraphStyle/defaultTabInterval)

The documentwide default tab interval.

### Getting text block and list information

[`textBlocks`](/documentation/AppKit/NSParagraphStyle/textBlocks)

The text blocks that contain the paragraph.

[`textLists`](/documentation/AppKit/NSParagraphStyle/textLists)

The text lists that contain the paragraph.

### Getting line-break information

[`lineBreakMode`](/documentation/AppKit/NSParagraphStyle/lineBreakMode)

The mode for breaking lines in the paragraph that don’t fit within a container.

[`NSLineBreakMode`](/documentation/AppKit/NSLineBreakMode)

Constants that specify what happens when a line is too long for a container.

[`lineBreakStrategy`](/documentation/AppKit/NSParagraphStyle/lineBreakStrategy-swift.property)

The strategy for breaking lines while laying out paragraphs.

[`LineBreakStrategy`](/documentation/AppKit/NSParagraphStyle/LineBreakStrategy-swift.struct)

Constants that specify how the text system breaks lines while laying out paragraphs.

[`hyphenationFactor`](/documentation/AppKit/NSParagraphStyle/hyphenationFactor)

The paragraph’s threshold for hyphenation.

[`usesDefaultHyphenation`](/documentation/AppKit/NSParagraphStyle/usesDefaultHyphenation)

A Boolean value that indicates whether the paragraph style uses the system hyphenation settings.

[`tighteningFactorForTruncation`](/documentation/AppKit/NSParagraphStyle/tighteningFactorForTruncation)

The threshold for using tightening as an alternative to truncation.

[`allowsDefaultTighteningForTruncation`](/documentation/AppKit/NSParagraphStyle/allowsDefaultTighteningForTruncation)

A Boolean value that indicates whether the system tightens character spacing before truncating text.

### Getting the html header level

[`headerLevel`](/documentation/AppKit/NSParagraphStyle/headerLevel)

The paragraph’s header level for HTML generation.

### Determining writing direction

[`+  defaultWritingDirectionForLanguage:`](/documentation/AppKit/NSParagraphStyle/defaultWritingDirection(forLanguage:))

Returns the default writing direction for the specified language.

[`baseWritingDirection`](/documentation/AppKit/NSParagraphStyle/baseWritingDirection)

The base writing direction for the paragraph.

[`NSWritingDirection`](/documentation/AppKit/NSWritingDirection)

Constants that specify the writing direction.

## Relationships

### Inherited By

[`NSMutableParagraphStyle`](/documentation/AppKit/NSMutableParagraphStyle)

### Conforms To

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

[`NSMutableCopying`](/documentation/Foundation/NSMutableCopying)

[`NSCopying`](/documentation/Foundation/NSCopying)

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

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

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

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSCoding`](/documentation/Foundation/NSCoding)

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

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)