Interactive previews iPhone

TextFieldLink

A control that requests text input from the user when pressed

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

Platform Compatibility

watchOS 9.0+

Tags

SwiftUI Code

Docs
TextFieldLink("Set Text", prompt: Text("Custom Placeholder")) { str in
  print("Typed text: \(str)")
}

Found an issue or have a suggestion?

Created: June 5, 2025Updated: December 27, 2025

More Link Components

View all
HelpLink - macOS - Flat Design - Light Mode - Preview
initializer

HelpLink

A button with a standard appearance that opens app-specific help documentation

Custom Preview Item ShareLink  - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Custom Preview Item ShareLink

Creates an instance, with a custom label, that presents the share interface

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

ShareLink

A view that controls a sharing presentation

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

Link

A control for navigating to a URL

Explore Other Components

Browse all
Delete Disabled - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

Delete Disabled

Adds a condition for whether the view’s view hierarchy is deletable.

Hidden List Row Separator - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

Hidden List Row Separator

Sets the display mode to hidden for the separator associated with this specific row.

Pinned Toolbar Item Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Pinned Toolbar Item Placement

A placement that pins the item to the trailing edge of the toolbar.

Disable Sheet Dismiss Swipe - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Disable Sheet Dismiss Swipe

Conditionally prevents interactive dismissal of presentations like popovers, sheets, and inspectors. Dragging the sheet is still possible to a limited extent, as shown in the screenshot, but it will never be dismissed.

Custom Value Label Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Custom Value Label Picker

Creates a picker that generates its label from a localized string key and accepts a custom current value label.

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

InlinePickerStyle

A PickerStyle where each option is displayed inline with other views in the current container.

Button Tint - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Button Tint

Sets the buttons tint color

Menu Section - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
content

Menu Section

A Section inside a Menu