textInputBorderShape(_:)
Sets the border shape for text input controls in the view hierarchy.
Declaration
nonisolated func textInputBorderShape(_ shape: TextInputBorderShape) -> some View
Parameters
- shape:
The shape to use for the border of text input controls.
Discussion
Use this modifier to customize the border shape of TextField and other text input controls. The shape can be applied to individual controls or to a container to affect all text input controls within it.
In this example, a search field and button both use a capsule shape:
HStack {
TextField("Search", text: $searchText)
Button("Go", action: search)
}
.buttonBorderShape(.capsule)
.textInputBorderShape(.capsule)See Also
Managing text entry
autocorrectionDisabled(_:)autocorrectionDisabledkeyboardType(_:)scrollDismissesKeyboard(_:)textContentType(_:)textInputAutocapitalization(_:)TextInputAutocapitalizationTextInputBorderShapetextInputCompletion(_:)textInputSuggestions(_:)textInputSuggestions(_:content:)textInputSuggestions(_:id:content:)textContentType(_:)textContentType(_:)textContentType(_:)