<!--
{
  "availability" : [
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/TextFieldLink/init(prompt:label:onSubmit:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI13TextFieldLinkV6prompt5label8onSubmitACyxGAA0C0VSg_xyXEySSctcfc"
  },
  "title" : "init(prompt:label:onSubmit:)"
}
-->

# init(prompt:label:onSubmit:)

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

```
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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)