# Input prompt (/start/input)



<CalloutContainer type="info">
  <CalloutTitle>
    UI screen
  </CalloutTitle>

  <CalloutDescription>
    You can find an example of the input prompt dialog UI in the <DynamicLink href="/start/interface-examples#input-prompt">interface examples</DynamicLink> section.
  </CalloutDescription>
</CalloutContainer>

<CalloutContainer type="info">
  <CalloutTitle>
    *ink*
  </CalloutTitle>

  <CalloutDescription>
    You can use this method with the *ink* syntax. See more <DynamicLink href="/ink/input">here</DynamicLink>.
  </CalloutDescription>
</CalloutContainer>

In visual novels, you may need to ask the player to enter text, numbers, dates, or other values.

Pixi’VN provides functions to handle input prompts. The developer can require the player to enter a value (the game will not continue until a value is provided), while the <DynamicLink href="/start/interface">UI</DynamicLink> is responsible for displaying the prompt.

## Request [#request]

To prompt the player for input, use the [`narration.input.request`](/jsdoc/pixi-vn/index/interfaces/NarrationInputInterface#request) function.

```ts title="content/labels/start.label.ts"
import { narration, newLabel } from "@drincs/pixi-vn";

export const startLabel = newLabel("start", [
    () => {
        narration.dialogue = "Hello";
    },
    () => {
        narration.dialogue = "What is your name?";
        narration.input.request({ type: "string" });
    },
    () => {
        narration.dialogue = `My name is ${narration.input.value}`;
    },
    () => {
        narration.dialogue = "How old are you?";
        narration.input.request({ type: "number" }, 18);
    },
    () => {
        narration.dialogue = `I am ${narration.input.value} years old`;
    },
    () => {
        narration.dialogue = "Describe who you are:";
        narration.input.request({ type: "html textarea" });
    },
    () => {
        narration.dialogue = `${narration.input.value}`;
    },
    () => {
        narration.dialogue = "Restart";
    },
]);
```

<PixiVnExample path="narration/input-prompt" />

## Get [#get]

To get input prompt information, use:

* [`narration.input.isRequired`](/jsdoc/pixi-vn/index/interfaces/NarrationInputInterface#isrequired)
* [`narration.input.type`](/jsdoc/pixi-vn/index/interfaces/NarrationInputInterface#type)

```ts
if (narration.input.isRequired) {
    openInputModal(narration.input.type);
}
```

## Remove [#remove]

To remove the input prompt request, use [`narration.input.removeRequest`](/jsdoc/pixi-vn/index/interfaces/NarrationInputInterface#removerequest).

```ts
narration.input.removeRequest();
```
