# MultiLineInput

> MultiLineInput is a text box of two to twelve lines with word wrap, for notes and descriptions players type freely, validated like TextInput.

URL: https://xichil.dev/docs/xis-mvui/v1/widgets/multi-line-input/ · Updated: 2026-11-06 · Applies to: Fabric, Quilt, Legacy Fabric, Forge, NeoForge, MC 1.7.10 - 26.3

A text box of several lines, for notes, descriptions or lists the player types freely. It wraps long lines at
the box's width and takes Enter as a line break; text longer than the box scrolls inside it.

```java
MultiLineInput.builder("notes")
        .label(Text.translatable("mymod.notes", "Notes"))
        .initial(config.notes)
        .lines(6)
        .maxLength(2000)
        .onChange(s -> config.notes = s)
        .build();
```

## Builder

| Method | Required | Default | Notes |
| --- | --- | --- | --- |
| `label(Supplier<Text>)` / `label(Text)` | yes | | the text above the box |
| `initial(String)` | no | `""` | line breaks may be `\n`, `\r\n` or `\r`; cut to `maxLength`; not passed to `onChange` |
| `maxLength(int)` | no | `1024` | the most characters, line breaks included; must be positive |
| `lines(int)` | no | `4` | how many lines the box shows at once (its height), from 2 to 12 |
| `validator(Function<String, Text>)` | no | every text is valid | returns an error, or `null` |
| `onChange(Consumer<String>)` | no | does nothing | receives the text after each edit that leaves it valid |
| `enabled`, `tooltip`, `visible` | no | | [options every widget has](https://xichil.dev/docs/xis-mvui/v1/widgets/index.md#options-every-widget-has) |

`build()` throws if the label is missing, `maxLength` isn't positive, or `lines` is outside 2 – 12.

## Behaviour

- Works like a [TextInput](https://xichil.dev/docs/xis-mvui/v1/widgets/text-input/index.md): the text lives in the entry, the error shows below the box, and
  `onChange` receives only valid text. `value()`, `isValid()`, `error()` and `setValue(…)` are the same.
- Line breaks are always `\n`, also for pasted `\r\n`. There is no limit on the number of lines apart from
  `maxLength`.
- From 1.19.3 it is vanilla's own multi-line edit box; older versions draw an equivalent box.
- **Footer:** no.

## Test it

```java
host.type("notes", "first line\nsecond line");
```

Rendered as `[textarea notes] Notes: "first line\nsecond line"`.

## See also

- Javadoc: [MultiLineInput](https://xichil.dev/javadoc/xis-mvui/v1/dev/xichil/mvui/MultiLineInput.html)
