View ModifieriOS 27.0+macOS 27.0+tvOS 27.0+watchOS 27.0+visionOS 27.0+textInputBorderShape(_:) in SwiftUI
Declaration
compose().textInputBorderShape(
shape: SwiftUI.TextInputBorderShape
)nonisolated func textInputBorderShape(
_ shape: TextInputBorderShape
) -> some ViewParameters
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
More in Drawing and shapes.
- blendModeSets the blend mode for compositing this view with overlapping views.
- buttonBorderShapeSets the border shape for buttons in this view.
- clipShapeSets a clipping shape for this view.
- containerShapeSets the container shape to use for any container relative shape within this view.
- contentShapeSets the content shape for this view.
- coordinateSpaceAssigns a name to the view's coordinate space, so other code can operate on dimensions like points and sizes relative to the named space.
- materialActiveAppearanceSets an explicit active appearance for materials in this view.