> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.enumtypebuilder/yarn.compiler.enumtypebuilder.fromenum.md).

# FromEnum\<TEnum>(string?)

Method in [EnumTypeBuilder](/3.1/api/csharp/yarn.compiler/yarn.compiler.enumtypebuilder.md)

## Summary

Creates a new [EnumType](/3.1/api/csharp/yarn/yarn.enumtype.md) given a CLR enum type.

```csharp
public static EnumType FromEnum<TEnum>(string? description = null)
    where TEnum : System.Enum
```

## Parameters

| Name                 | Description                                                 |
| -------------------- | ----------------------------------------------------------- |
| `string` description | An optional description to apply to the new Yarn enum type. |

## Type Parameters

| Name  | Description               |
| ----- | ------------------------- |
| TEnum | The type of the CLR enum. |

## Returns

A Yarn type representing the enum.
