# dialog/prompt
Open a single-line text input dialog.
## Syntax
[dialog/prompt "Title" ?default]
## Parameters
- `"Title"` — dialog title (defaults to `"Input"`)
- `?default` — optional pre-filled text
## Examples
[dialog/prompt "Name"] [dialog/prompt "Name" "Alice"] [dialog/prompt %{ :title "Name" :default "Alice" }] [dialog/prompt :session-name "Name" "Alice"] # explicit id → :data~id :session-name
## Returns
In TUI hosts the call returns immediately — `true` when an explicit id was given (leading keyword or `:id` in the spec map), else the numeric request-id. Behavior depends on the build:
- TUI (`retro`, `retra`) — returns immediately; the result arrives
later as a `:message` event with topic `"dialog-result"` and a structured
`:data` map `%{ :id :value :cancelled }` where `:value` carries the entered string (empty when cancelled).
- `deft` scripting binary — blocks on stdin and returns the entered text.
## See Also
`dialog/password`, `dialog/confirm`, `dialog/msgbox`