Capsule Text Field

Gives your text field a capsule shape. This only has a visible effect on macOS, where the capsule shape is not the default.

Capsule Text Field - Preview Not Available

Platform Compatibility

iOS 27.0+ iPadOS 27.0+ macOS 27.0+ watchOS 27.0+ tvOS 27.0+ visionOS 27.0+

Tags

SwiftUI Code

Docs
TextField("Foo", text: $searchText)
    .textInputBorderShape(.capsule)

Found an issue or have a suggestion?

Created: September 3, 2026Updated: September 3, 2026

Explore Other Components

Browse all
TabsPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

TabsPickerStyle

A picker style that presents options as segmented tabs. On macOS, this style produces a segmented picker with a visual treatment that distinguishes tab navigation from value selection. On iOS, tvOS, and visionOS, the visual appearance matches that of the standard standard .segmented style. On all supported platforms, VoiceOver announces options as tabs.

TextFieldLink - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
initializer

TextFieldLink

A control that requests text input from the user when pressed

Standard Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
type

Standard Colors

The SwiftUI standard colors

Hide Sidebar Toggle - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
modifier

Hide Sidebar Toggle

Removes the sidebar toggle toolbar item a NavigationSplitView adds by default.

Music Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Music Picker

Presents a music picker to select items from the Apple Music catalog and the user’s music library.

PaletteControlGroupStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

PaletteControlGroupStyle

A control group style that presents its content as a palette.

NavigationSplitView - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

NavigationSplitView

Creates a two-column navigation split view.

Fitted Sheet Sizing - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Fitted Sheet Sizing

Sets the sizing of the containing presentation. This does not have any effect on smaller devices like iPhone and Apple Watch. On macOS, fitted is the default.