> For the complete documentation index, see [llms.txt](https://cyr1en.gitbook.io/commandprompter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cyr1en.gitbook.io/commandprompter/prompts/dialog-ui-prompt.md).

# Dialog UI Prompt

Use `d:` to build a native Paper dialog. Dialog prompts support text, number, choice, tab-completion, and compound layouts.

## Text

An empty or unknown filter becomes a text field. `text` may be written explicitly.

```
<d:Question>
<d:text:Question>
<d:text[256,4,300]:Question>
<d:text[max_length=256,max_lines=4,width=300]:Question>
```

Positional values are `maxLength,maxLines,width`. Keyed values may appear in any order. Each numeric override is clamped to 1–8192; `max_lines > 1` enables multiline input.

## Number

`num`, `number`, and `numberrange` are aliases.

```
<d:num[0,100]:Percentage>
<d:num[0,100,5]:Percentage>
<d:num[0,100,5,50]:Percentage>
```

The positions are `min,max,step,initial`. If `min >= max`, the effective maximum becomes `min + 1`. A nonpositive step becomes `1`. Without an inline initial value, an overridden range starts at its midpoint; explicit initial values are clamped into the range.

## Choice

```
<d:choice[set,add,remove]:Action>
```

Blank options are discarded, the first remaining option is selected initially, and its display text is also the returned answer. Omitting the list uses `DialogUI.Defaults.Choice.Default-Options`.

## Tab completion

```
<d:tab:Argument>
<d:tab[8]:Argument>
```

CommandPrompter requests completions for the command assembled up to this prompt. One button is shown per completion when the count is between 1 and the effective threshold. Zero completions or too many completions opens a text-input fallback. The inline threshold has a minimum of 1.

`d:tab` cannot be used inside a compound dialog.

## Compound layouts

Separate rows with top-level `&&`. Spaces around `&&` are optional.

```
<d:title:Portal Request && d:body[plain,width=300]:Review the requirements. && d:choice[approve,deny]:Action && d:text[512,6,300]:Reason>
```

The available row filters are:

| Filter                                                     | Purpose                                                                                                 | Returned answer  |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ---------------- |
| `title`                                                    | Sets the native dialog window title. The first title row wins.                                          | None (0 answers) |
| `body`                                                     | Adds a plain text body element with automatic width.                                                    | None (0 answers) |
| `body[300]`, `body[plain,300]`, or `body[plain,width=300]` | Adds wrapped text with width clamped to 1–1024 pixels.                                                  | None (0 answers) |
| `body[item]`                                               | Treats the display value as a Bukkit material and shows one item. Invalid materials fall back to Paper. | None (0 answers) |
| `text[...]`                                                | Adds a text input.                                                                                      | Entered text     |
| `choice[...]`                                              | Adds a dropdown.                                                                                        | Selected option  |
| `num[...]`                                                 | Adds a number range.                                                                                    | Selected number  |

`title` and `body` are compound-only. Using either as a standalone prompt sends an error and cancels the session.

### Answer arity

In 3.2.0, layout rows (`title` and `body`) produce 0 answers and do not consume answer positions:

* Multi-input dialogs produce exactly N answers (one per input row).
* Info-only dialogs (containing only `title` and `body` rows) produce 0 answers.
* Zero-arity dialogs and layout rows never shift `{input:N}` or `{N}` answer indices in post-commands.

Row-processing flags such as `-ds`, `-iv:alias`, `-int`, and `-str` are validated against actual input rows. The `-t` flag is extracted once for the whole compound and shows one Adventure title before the native dialog; it is separate from `d:title`, which sets the dialog window title.

## Dialog lifecycle

Prompt dialogs cannot be dismissed with Escape. Client component actions—including MiniMessage `open_url` links in body text—leave the dialog open. Confirm, Cancel, Exit, or an answer button closes the dialog explicitly and then completes or cancels the session. Timeout, `/cmdp cancel`, reload, disconnect, and other server-side teardown can also close it; opening a link does not reset `Prompt-Timeout`.

With the default `< >` prompt delimiters, escape the nested MiniMessage delimiters so they do not terminate the outer prompt tag:

```
<d:title:Portal Request && d:body[plain,width=300]:\<click:open_url:"https://example.com"\>Portal Docs\</click\> && d:text:Notes>
```

The backslashes are removed before MiniMessage renders the body. Another option is to configure non-angle prompt delimiters, such as `{.*?}`, so ordinary MiniMessage `<click>...</click>` tags do not conflict.

See [Dialog UI settings](/commandprompter/configuration/prompts-configuration/dialog-ui.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cyr1en.gitbook.io/commandprompter/prompts/dialog-ui-prompt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
