# StatusLine

> StatusLine is the line a screen's actions write their results to, colored by kind (info, success, warning, error) and empty until shown.

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

A line the screen's actions write their results to, such as "Loaded 'default'" or "Couldn't write the file".
It is empty until a message is shown, and backends color the text by its kind.

```java
StatusLine status = StatusLine.builder("status").build();

Button save = Button.builder("save")
        .label(Text.translatable("mymod.save", "Save"))
        .onPress(() -> host.runAsync(() -> {
            store.save();
            return null;
        }, (ignored, error) -> {
            if (error != null) {
                status.show(StatusLine.Kind.ERROR, Text.translatable("mymod.save.failed", "Save failed: %s",
                        Text.literal(String.valueOf(error.getMessage()))));
            } else {
                status.show(StatusLine.Kind.SUCCESS, Text.translatable("mymod.saved", "Saved"));
            }
        }))
        .build();

MenuScreen.builder("main").title(title).add(status).add(save).build();
```

## Builder

`StatusLine.builder(id).build()`. There are no required fields; `enabled`, `tooltip` and `visible` work as on
[every widget](https://xichil.dev/docs/xis-mvui/v1/widgets/index.md#options-every-widget-has).

## Methods

| Method | Does |
| --- | --- |
| `show(Kind, Text)` | shows a message, replacing the previous one. Throws `IllegalStateException` on `null`. |
| `clear()` | empties the line and resets the kind to `INFO` |
| `text()` | the current message, or `null` while empty |
| `kind()` | the current kind; `INFO` while empty |

| `StatusLine.Kind` | For |
| --- | --- |
| `INFO` | neutral information |
| `SUCCESS` | the action worked |
| `WARNING` | something to notice, or a partial failure |
| `ERROR` | the action failed |

## Behaviour

- Keep a reference to the built status line, so actions can write to it.
- Unlike other widgets it has no supplier: the message is state of the entry and stays until replaced.
- `show` and `clear` are safe from any thread. The message appears on the next refresh, which happens by itself
  after an action or a `runAsync` callback; elsewhere call `host.refresh()`.
- A `ConfirmDialog`'s answer runs after the dialog closes, so it can write to the status line of the screen that
  opened it.
- **Footer:** yes.

## Test it

Rendered as `[status status] SUCCESS Saved`, or `[status status] ` while empty.

## See also

- Javadoc: [StatusLine](https://xichil.dev/javadoc/xis-mvui/v1/dev/xichil/mvui/StatusLine.html)
- [Slow work: files and network](https://xichil.dev/docs/xis-mvui/v1/guides/async-work/index.md)
