---
title: "Shared enum domains (EnumDecl)"
description: "Generated from the doc schema (CatalogDocSchema, @canonify/kernel-catalog/doc): each field’s type, default and description are the schema’s own, and each example is a bundle file that readBundle…"
order: 5
id: "model/enum"
---

# Shared enum domains (EnumDecl)

Generated from the doc schema (`CatalogDocSchema`, @canonify/kernel-catalog/doc): each field’s type, default and description are the schema’s own, and each example is a bundle file that readBundle decodes. A field’s Example is its value in one of those examples.

## EnumDecl {#enumdecl}

A shared enum domain: one list of values that several enum and set properties and action inputs name.

The `enums` slot of the doc holds these, keyed by id. In a bundle each is one file, `enums/<name>.json`, named by its `name`, which the file then leaves out.

| Field | Type | Required | Default | Example | Description |
|---|---|---|---|---|---|
| `id` | [EnumId](shapes.md#enumid) | yes (propose assigns it; a new declaration leaves it out) | — | — | A shared enum id (`en_…`); renames keep it. |
| `name` | [Ident](shapes.md#ident) | yes | — | `"position"` | The domain name: how a typeref names it (`enum<position>`), unique among the domains. |
| `label` | [Text](shapes.md#text) | yes (a draft may leave it out: propose writes a default made from the name, `catalog.label_defaulted`) | — | `"Position"` | The words shown for the domain. |
| `values` | [EnumValue](value-type.md#enumvalue)[] | yes | — | (see the example) | The declared values, in their order. |
| `ordered` | boolean | no | — | `false` | Whether the declared order is a ranking (comparisons and sorting follow it). |

`enums/position.json`

```json
{
  "label": "Position",
  "values": [
    { "code": "chef", "label": "Chef" },
    { "code": "waiter", "label": "Waiter" }
  ],
  "ordered": false
}
```
