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

# NSTextListElement

A class that represents a text list node.

```
class NSTextListElement
```

## Topics

### Create a text list element

[`+  textListElementWithChildElements:textList:nestingLevel:`](/documentation/AppKit/NSTextListElement/init(children:textList:nestingLevel:))

Creates a text list element with the list elements and nesting level you provide.

[`+  textListElementWithContents:markerAttributes:textList:childElements:`](/documentation/AppKit/NSTextListElement/init(contents:markerAttributes:textList:children:))

Creates a text list element with the list elements, nesting level, and marker attributes you provide.

[`-  initWithParentElement:textList:contents:markerAttributes:childElements:`](/documentation/AppKit/NSTextListElement/init(parent:textList:contents:markerAttributes:children:))

Creates a text list element with the parent, list elements, nesting level, and marker attributes you provide.

### Accessing the text elements

[`textList`](/documentation/AppKit/NSTextListElement/textList)

The value that represents the text list.

[`parentElement`](/documentation/AppKit/NSTextListElement/parent)

A text list element that refers to the enclosing text list element.

[`childElements`](/documentation/AppKit/NSTextListElement/childElements)

An array that contains child text elements.

### Accessing the text list’s attributes

[`markerAttributes`](/documentation/AppKit/NSTextListElement/markerAttributes)

A dictionary of attributed string keys and IDs that represent the list’s marker attributes.

### Accessing the formatted string data

[`attributedString`](/documentation/AppKit/NSTextListElement/attributedString)

An attributed string that represents the string the framework displays for this element taking into account markers and the indentation level of the list element.

[`contents`](/documentation/AppKit/NSTextListElement/contents)

The text list element contents without markers and formatting.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

### Inherits From

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

---

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)