# Enum.Label, Enum.Description, Enum.Name

> Read the human-facing words of an enum value in code: its Label (the [Label] text, or the member name when there is none), its Description (the member's doc comment), and its Name (the member's identifier). The screen shows the label for you automatically; reach for these only when a function needs the words.

<!-- id: function-enum-words · area: function · stability: stable · html: https://osysharp.com/reference/function/enum-words/ -->

## Summary        {#summary}
An enum member has three faces you can read in code from a value: `value.Name` is the member's identifier
(`"Placed"`), `value.Label` is what a person reads (the `[Label("…")]` text, or the name when there is
none), and `value.Description` is the member's doc-comment sentence. They lower to the stdlib calls
`Enum.Name`, `Enum.Label` and `Enum.Description`.

## Signature      {#signature}
```osy syntax
value.Name         -> string      // the member identifier, e.g. "Placed"    (Enum.Name)
value.Label        -> string      // the [Label] label, else the name       (Enum.Label)
value.Description  -> string      // the member's /// doc comment              (Enum.Description)
```

## Description    {#description}
These read the words declared with the enum ([[Label], [Icon], [Tone] — what a human reads](https://osysharp.com/reference/enum/labels/)): `[Label("…")]` sets the **label**, a `///`
doc comment sets the **description**, and the member identifier is the **name**.

- **`value.Label`** is the display text. If the member has a `[Label("…")]`, that is the label; otherwise the
  label falls back to the member **name**, because the name is usually already readable.
- **`value.Description`** is the longer sentence from the member's doc comment — the help text under an option,
  for instance. A member with no doc comment has an empty description.
- **`value.Name`** is always the raw identifier, ignoring any `[Label]`.

**You rarely need these for display.** Showing an enum-typed value on a screen already renders its label for
you ([[Label], [Icon], [Tone] — what a human reads](https://osysharp.com/reference/enum/labels/)) — reach for `.Label`/`.Description`/`.Name` when a *function* needs the words: building
a message, an export column, an audit line.

Because the words come from the app's model (which the client already has), these run **in the browser** with
no round trip, just like the rest of the pure surface ([execution side](https://osysharp.com/reference/function/execution-side/)).

## Examples       {#examples}
```osy title="an enum with a label and a description" test app=enum-words
enum OrderStatus {
  /// The order is placed but has not shipped yet.
  [Label("Awaiting shipment")] Placed,

  Shipped,
}

// Build a one-line status message from the words, not the stored value.
string StatusLine(OrderStatus s) {
  return s.Label + " — " + s.Description;
}
```

```osy title="the exact words, pinned" run app=enum-words
[Test]
void Enum_words() {
  // a member WITH a [Label] and a doc comment
  Assert.Equal("Placed", OrderStatus.Placed.Name);                 // the identifier
  Assert.Equal("Awaiting shipment", OrderStatus.Placed.Label);      // the [Label] text
  Assert.Equal("The order is placed but has not shipped yet.", OrderStatus.Placed.Description);

  // a member WITHOUT a [Label]: the label falls back to the name
  Assert.Equal("Shipped", OrderStatus.Shipped.Name);
  Assert.Equal("Shipped", OrderStatus.Shipped.Label);              // no [Label] → the name

  Assert.Equal("Awaiting shipment — The order is placed but has not shipped yet.",
    StatusLine(OrderStatus.Placed));
}
```

## See also       {#see-also}
- [[Label], [Icon], [Tone] — what a human reads](https://osysharp.com/reference/enum/labels/) — declaring the `[Label]` label and the doc-comment description these read
- [enum](https://osysharp.com/reference/enum/declaration/) — the `enum` keyword and how a member is stored
- [switch](https://osysharp.com/reference/function/switch/) — branching on an enum value
