# Ids

> The rules for screen and entry ids, what they are used for, and the derived ids that dropdowns, color pickers and list editors reserve.

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

Every screen and every entry has an id. Players never see ids; tests and logs use them.

## The rules

- An id matches `[A-Za-z0-9_.-]+`: letters, digits, `_`, `.` and `-`. A bad id throws
  `IllegalArgumentException` from `builder(id)` at once.
- **Entry ids are unique within one `MenuScreen`**: list entries, section children and footer entries
  together. A duplicate makes `build()` throw `IllegalStateException`.
- Screen ids need not be unique, but a distinct id per screen makes tests and logs easier to read.
- The mod id you pass to `register` follows stricter rules (see [Register your menu](https://xichil.dev/docs/xis-mvui/v1/guides/registering/index.md)).

## What ids are for

- **Tests** find entries by id: `host.click("save")`, `host.current().id()`.
- **Your code** can reach a typed entry from the screen: `(TextInput) screen.entry("name")`.
- **Logs** name the entry whose code failed, for example `Toggle 'sounds' value`.

## Derived ids

Composite widgets build their parts from ordinary entries, with ids derived from their own. Keep these free on
the same screen:

| Widget with id `x` | Reserves |
| --- | --- |
| [Dropdown](https://xichil.dev/docs/xis-mvui/v1/widgets/dropdown/index.md) | `x.picker` (picker screen), `x.list`, `x.cancel` |
| [ColorPicker](https://xichil.dev/docs/xis-mvui/v1/widgets/color-picker/index.md) | `x.editor` (editor screen), `x.preview`, `x.red`, `x.green`, `x.blue`, `x.alpha`, `x.hex`, `x.done`, `x.cancel` |
| [StringListEditor](https://xichil.dev/docs/xis-mvui/v1/widgets/string-list-editor/index.md) | `x.list`, `x.input`, `x.add`, `x.remove` |
| [Section](https://xichil.dev/docs/xis-mvui/v1/widgets/section/index.md) | none: the header uses `x` itself |

A good habit is to use dotted ids for your own related entries too, such as `zoomKey` and `zoomKey.reset`.

## Next steps

- [Test menus without Minecraft](https://xichil.dev/docs/xis-mvui/v1/guides/testing/index.md): ids in practice.
