---
title: "init(_:prompt:onSubmit:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/textfieldlink/init(_:prompt:onsubmit:)"
---

# init(_:prompt:onSubmit:)

Creates a TextFieldLink which when pressed will request text input from the user.

## Declaration

```swift
nonisolated init(_ titleKey: LocalizedStringKey, prompt: Text? = nil, onSubmit: @escaping (String) -> Void)
```

## Parameters

- `titleKey`: A key for the TextFieldLink’s localized title, that describes the purpose of requesting text input.
- `prompt`: Text which describes the reason for requesting text input.
- `onSubmit`: An action to perform when text input has been accepted and dismissed

## See Also

### Creating a text field link

- [init(prompt:label:onSubmit:)](swiftui/textfieldlink/init(prompt:label:onsubmit:).md)
