<!--
{
  "documentType" : "article",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View-Text-and-Symbols",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Text and symbol modifiers"
}
-->

# Text and symbol modifiers

Manage the rendering, selection, and entry of text in your view.

## Overview

SwiftUI provides built-in views that display text to the user,
like [`Text`](/documentation/SwiftUI/Text) and [`Label`](/documentation/SwiftUI/Label), or that collect text from the user, like
[`TextField`](/documentation/SwiftUI/TextField) and [`TextEditor`](/documentation/SwiftUI/TextEditor). Use text and symbol modifiers
to control how SwiftUI displays and manages that text. For example,
you can set a font, specify text layout parameters, and indicate
what kind of input to expect.

To learn more about the kinds of views that you use to display text
and the ways in which you can configure those views, see
[Text input and output](/documentation/SwiftUI/Text-input-and-output).

## Topics

### Fonts

[`font(_:)`](/documentation/SwiftUI/View/font(_:))

Sets the default font for text in this view.

### Dynamic type

[`dynamicTypeSize(_:)`](/documentation/SwiftUI/View/dynamicTypeSize(_:))

Sets the Dynamic Type size within the view to the given value.

### Text style

[`bold(_:)`](/documentation/SwiftUI/View/bold(_:))

Applies a bold font weight to the text in this view.

[`fontDesign(_:)`](/documentation/SwiftUI/View/fontDesign(_:))

Sets the font design of the text in this view.

[`fontWeight(_:)`](/documentation/SwiftUI/View/fontWeight(_:))

Sets the font weight of the text in this view.

[`fontWidth(_:)`](/documentation/SwiftUI/View/fontWidth(_:))

Sets the font width of the text in this view.

[`italic(_:)`](/documentation/SwiftUI/View/italic(_:))

Applies italics to the text in this view.

[`monospaced(_:)`](/documentation/SwiftUI/View/monospaced(_:))

Modifies the fonts of all child views to use the fixed-width variant of
the current font, if possible.

[`monospacedDigit()`](/documentation/SwiftUI/View/monospacedDigit())

Modifies the fonts of all child views to use fixed-width digits, if
possible, while leaving other characters proportionally spaced.

[`strikethrough(_:pattern:color:)`](/documentation/SwiftUI/View/strikethrough(_:pattern:color:))

Applies a strikethrough to the text in this view.

[`textCase(_:)`](/documentation/SwiftUI/View/textCase(_:))

Sets a transform for the case of the text contained in this view when
displayed.

[`textScale(_:isEnabled:)`](/documentation/SwiftUI/View/textScale(_:isEnabled:))

Applies a text scale to text in the view.

[`textRenderer(_:)`](/documentation/SwiftUI/View/textRenderer(_:))

Returns a new view such that any text views within it will use
`renderer` to draw themselves.

[`underline(_:pattern:color:)`](/documentation/SwiftUI/View/underline(_:pattern:color:))

Applies an underline to the text in this view.

[`attributedTextFormattingDefinition(_:)`](/documentation/SwiftUI/View/attributedTextFormattingDefinition(_:))

Apply a text formatting definition to nested views.

### Label configuration

[`labelIconToTitleSpacing(_:)`](/documentation/SwiftUI/View/labelIconToTitleSpacing(_:))

Set the spacing between the icon and title in labels.

[`labelReservedIconWidth(_:)`](/documentation/SwiftUI/View/labelReservedIconWidth(_:))

Set the width reserved for icons in labels.

### Text layout

[`allowsTightening(_:)`](/documentation/SwiftUI/View/allowsTightening(_:))

Sets whether text in this view can compress the space between characters
when necessary to fit text in a line.

[`baselineOffset(_:)`](/documentation/SwiftUI/View/baselineOffset(_:))

Sets the vertical offset for the text relative to its baseline
in this view.

[`flipsForRightToLeftLayoutDirection(_:)`](/documentation/SwiftUI/View/flipsForRightToLeftLayoutDirection(_:))

Sets whether this view mirrors its contents horizontally when the layout
direction is right-to-left.

[`kerning(_:)`](/documentation/SwiftUI/View/kerning(_:))

Sets the spacing, or kerning, between characters for the text in this view.

[`lineHeight(_:)`](/documentation/SwiftUI/View/lineHeight(_:))

A modifier for the default line height in the view hierarchy.

[`minimumScaleFactor(_:)`](/documentation/SwiftUI/View/minimumScaleFactor(_:))

Sets the minimum amount that text in this view scales down to fit in the
available space.

[`tracking(_:)`](/documentation/SwiftUI/View/tracking(_:))

Sets the tracking for the text in this view.

[`truncationMode(_:)`](/documentation/SwiftUI/View/truncationMode(_:))

Sets the truncation mode for lines of text that are too long to fit in
the available space.

[`typesettingLanguage(_:isEnabled:)`](/documentation/SwiftUI/View/typesettingLanguage(_:isEnabled:))

Specifies the language for typesetting.

[`writingDirection(strategy:)`](/documentation/SwiftUI/View/writingDirection(strategy:))

A modifier for the default text writing direction strategy in the view
hierarchy.

### Multiline text

[`lineLimit(_:)`](/documentation/SwiftUI/View/lineLimit(_:))

Sets to a closed range the number of lines that text can occupy in
this view.

[`lineLimit(_:reservesSpace:)`](/documentation/SwiftUI/View/lineLimit(_:reservesSpace:))

Sets a limit for the number of lines text can occupy in this view.

[`lineSpacing(_:)`](/documentation/SwiftUI/View/lineSpacing(_:))

Sets the amount of space between lines of text in this view.

[`multilineTextAlignment(_:)`](/documentation/SwiftUI/View/multilineTextAlignment(_:))

Sets the alignment of a text view that contains multiple lines of text.

[`multilineTextAlignment(strategy:)`](/documentation/SwiftUI/View/multilineTextAlignment(strategy:))

A modifier for the default text alignment strategy in the view
hierarchy.

### Text selection

[`textSelection(_:)`](/documentation/SwiftUI/View/textSelection(_:))

Controls whether people can select text within this view.

[`textSelectionAffinity(_:)`](/documentation/SwiftUI/View/textSelectionAffinity(_:))

Sets the direction of a selection or cursor relative to a text character.

### Data detection

[`dataDetection(_:options:)`](/documentation/SwiftUI/View/dataDetection(_:options:))

Asynchronously detects data in the view’s content and
styles them to indicate they are clickable.

### Text entry

[`autocorrectionDisabled(_:)`](/documentation/SwiftUI/View/autocorrectionDisabled(_:))

Sets whether to disable autocorrection for this view.

[`keyboardType(_:)`](/documentation/SwiftUI/View/keyboardType(_:))

Sets the keyboard type for this view.

[`scrollDismissesKeyboard(_:)`](/documentation/SwiftUI/View/scrollDismissesKeyboard(_:))

Configures the behavior in which scrollable content interacts with
the software keyboard.

[`textInputAutocapitalization(_:)`](/documentation/SwiftUI/View/textInputAutocapitalization(_:))

Sets how often the shift key in the keyboard is automatically enabled.

[`textInputBorderShape(_:)`](/documentation/SwiftUI/View/textInputBorderShape(_:))

Sets the border shape for text input controls in the view hierarchy.

[`textInputCompletion(_:)`](/documentation/SwiftUI/View/textInputCompletion(_:))

Associates a fully formed string with the value of this view when used
as a text input suggestion

[`textInputSuggestions(_:)`](/documentation/SwiftUI/View/textInputSuggestions(_:))

Configures the text input suggestions for this view.

[`textInputSuggestions(_:content:)`](/documentation/SwiftUI/View/textInputSuggestions(_:content:))

Configures the text input suggestions for this view.

[`textInputSuggestions(_:id:content:)`](/documentation/SwiftUI/View/textInputSuggestions(_:id:content:))

Configures the text input suggestions for this view.

[`textContentType(_:)`](/documentation/SwiftUI/View/textContentType(_:))

Sets the text content type for this view, which the system uses to
offer suggestions while the user enters text on macOS.

[`textContentType(_:)`](/documentation/SwiftUI/View/textContentType(_:)-4dqqb)

Sets the text content type for this view, which the system uses to offer
suggestions while the user enters text on a watchOS device.

[`textContentType(_:)`](/documentation/SwiftUI/View/textContentType(_:)-6fic1)

Sets the text content type for this view, which the system uses to
offer suggestions while the user enters text on macOS.

[`textContentType(_:)`](/documentation/SwiftUI/View/textContentType(_:)-ufdv)

Sets the text content type for this view, which the system uses to
offer suggestions while the user enters text on an iOS or tvOS device.

[`textInputFormattingControlVisibility(_:for:)`](/documentation/SwiftUI/View/textInputFormattingControlVisibility(_:for:))

Specifies which system text formatting controls are available
for people to format text.

### Find and replace

[`findNavigator(isPresented:)`](/documentation/SwiftUI/View/findNavigator(isPresented:))

Programmatically presents the find and replace interface for text
editor views.

[`findDisabled(_:)`](/documentation/SwiftUI/View/findDisabled(_:))

Prevents find and replace operations in a text editor.

[`replaceDisabled(_:)`](/documentation/SwiftUI/View/replaceDisabled(_:))

Prevents replace operations in a text editor.

### Symbol appearance

[`symbolRenderingMode(_:)`](/documentation/SwiftUI/View/symbolRenderingMode(_:))

Sets the rendering mode for symbol images within this view.

[`symbolColorRenderingMode(_:)`](/documentation/SwiftUI/View/symbolColorRenderingMode(_:))

Sets the color rendering mode for symbol images.

[`symbolVariableValueMode(_:)`](/documentation/SwiftUI/View/symbolVariableValueMode(_:))

Sets the variable value mode mode for symbol images within this view.

[`symbolVariant(_:)`](/documentation/SwiftUI/View/symbolVariant(_:))

Makes symbols within the view show a particular variant.

### Writing Tools

[`writingToolsAffordanceVisibility(_:)`](/documentation/SwiftUI/View/writingToolsAffordanceVisibility(_:))

Specifies whether the system should show the Writing Tools affordance
for text input views affected by the environment.

[`writingToolsBehavior(_:)`](/documentation/SwiftUI/View/writingToolsBehavior(_:))

Specifies the Writing Tools behavior for text and text input in the
environment.

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

The Writing Tools editing experience for text and text input.



---

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)