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

# init(prompt:label:onSubmit:)

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

## Declaration

```swift
nonisolated init(prompt: Text? = nil, @ContentBuilder label: () -> Label, onSubmit: @escaping (String) -> Void)
```

## Parameters

- `prompt`: Text which describes the reason for requesting text input.
- `label`: A view that describes the action of 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:onSubmit:)](swiftui/textfieldlink/init(_:prompt:onsubmit:).md)
