<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/textInputBorderShape(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE20textInputBorderShapeyQrAA04TextefG0VF"
  },
  "title" : "textInputBorderShape(_:)"
}
-->

# textInputBorderShape(_:)

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

```
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`](/documentation/SwiftUI/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)
```

---

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)