<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/TextEditorStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15TextEditorStyleP"
  },
  "title" : "TextEditorStyle"
}
-->

# TextEditorStyle

A specification for the appearance and interaction of a text editor.

```
@MainActor @preconcurrency protocol TextEditorStyle
```

## Overview

A type conforming to this protocol inherits `@preconcurrency @MainActor`
isolation from the protocol if the conformance is included in the type’s
base declaration:

```
struct MyCustomType: Transition {
    // `@preconcurrency @MainActor` isolation by default
}
```

Isolation to the main actor is the default, but it’s not required. Declare
the conformance in an extension to opt out of main actor isolation:

```
extension MyCustomType: Transition {
    // `nonisolated` by default
}
```

## Topics

### Getting built-in styles

[`automatic`](/documentation/SwiftUI/TextEditorStyle/automatic)

The default text editor style, based on the text editor’s context.

[`plain`](/documentation/SwiftUI/TextEditorStyle/plain)

A text editor style with no decoration.

[`roundedBorder`](/documentation/SwiftUI/TextEditorStyle/roundedBorder)

A text editor style with a system-defined rounded border.

### Creating custom styles

[`makeBody(configuration:)`](/documentation/SwiftUI/TextEditorStyle/makeBody(configuration:))

Creates a view that represents the body of a text editor.

[`Configuration`](/documentation/SwiftUI/TextEditorStyle/Configuration)

The properties of a text editor.

[`Body`](/documentation/SwiftUI/TextEditorStyle/Body)

A view that represents the body of a text editor.

### Supporting types

[`AutomaticTextEditorStyle`](/documentation/SwiftUI/AutomaticTextEditorStyle)

The default text editor style, based on the text editor’s context.

[`PlainTextEditorStyle`](/documentation/SwiftUI/PlainTextEditorStyle)

A text editor style with no decoration.

[`RoundedBorderTextEditorStyle`](/documentation/SwiftUI/RoundedBorderTextEditorStyle)

A text editor style with a system-defined rounded border.

## Relationships

### Conforming Types

[`PlainTextEditorStyle`](/documentation/SwiftUI/PlainTextEditorStyle)

[`AutomaticTextEditorStyle`](/documentation/SwiftUI/AutomaticTextEditorStyle)

[`RoundedBorderTextEditorStyle`](/documentation/SwiftUI/RoundedBorderTextEditorStyle)

---

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)