<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSParagraphStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSParagraphStyle"
  },
  "title" : "NSParagraphStyle"
}
-->

# NSParagraphStyle

The paragraph or ruler attributes for an attributed string.

```
class NSParagraphStyle
```

## Overview

An [`NSParagraphStyle`](/documentation/UIKit/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 in Swift or the [`NSParagraphStyleAttributeName`](/documentation/UIKit/NSParagraphStyleAttributeName) attribute in Objective-C 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/UIKit/NSParagraphStyle) class manages an immutable set of style information, but you can create an [`NSMutableParagraphStyle`](/documentation/UIKit/NSMutableParagraphStyle) when you want to modify the style information before applying it to your text.

## Topics

### Creating a paragraph style

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

The default paragraph style.

### Accessing style information

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

The text alignment of the paragraph.

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

Constants that specify text alignment.

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

The indentation of the first line of the paragraph.

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

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

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

The trailing indentation of the paragraph.

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

The line height multiple.

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

The paragraph’s maximum line height.

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

The paragraph’s minimum line height.

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

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

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

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

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

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

### Accessing tab information

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

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

  <doc://com.apple.documentation/documentation/AppKit/NSParagraphStyle/TextTabType>

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

The documentwide default tab interval.

### Getting text block and list information

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

The text blocks that contain the paragraph, nested from outermost to innermost.

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

The text lists that contain the paragraph.

### Getting line-break information

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

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

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

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

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

The strategy for breaking lines while laying out paragraphs.

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

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

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

The paragraph’s threshold for hyphenation.

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

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

  <doc://com.apple.documentation/documentation/AppKit/NSParagraphStyle/tighteningFactorForTruncation>

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

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

### Getting the HTML header level

  <doc://com.apple.documentation/documentation/AppKit/NSParagraphStyle/headerLevel>

### Determining writing direction

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

Returns the default writing direction for the specified language.

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

The base writing direction for the paragraph.

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

Constants that specify the writing direction.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

### Inherits From

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

### Inherited By

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

---

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)