> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/umbraco-cms/extend-your-project/backoffice-extensions/extending-overview/extension-types/value-type.md).

# Value Type

In an extensible system, different parts of the codebase need to agree on what kind of data they are working with. A value type is the contract that makes this possible — a named string constant that identifies the kind of data a value holds. Define one, and you get compile-time autocomplete and type checking wherever value-type keys are accepted across the system. [Value Summary](/umbraco-cms/extend-your-project/backoffice-extensions/extending-overview/extension-types/value-summary.md) extensions are one example of where value types are used to match a value to the right renderer.

## Built-in types

For common values, the core package already provides value types you can use directly. Import them from `@umbraco-cms/backoffice/value-type`.

| Constant                   | Key                      | TypeScript type     |
| -------------------------- | ------------------------ | ------------------- |
| `UMB_STRING_VALUE_TYPE`    | `Umb.ValueType.String`   | `string`            |
| `UMB_BOOLEAN_VALUE_TYPE`   | `Umb.ValueType.Boolean`  | `boolean`           |
| `UMB_DATE_TIME_VALUE_TYPE` | `Umb.ValueType.DateTime` | `string` (ISO 8601) |

If your data matches one of these, you can use the constant directly without defining your own.

## Defining a value type

When none of the built-in types describe your data, define your own. Declare a constant with `as const` and extend the global `UmbValueTypeMap` interface in the same file. The TypeScript type you assign is the shape of the data this value type represents:

{% code title="my-feature/value-type/constants.ts" %}

```typescript
export type MyStatusValue = 'active' | 'inactive' | 'pending';

export const MY_STATUS_VALUE_TYPE = 'My.ValueType.Status' as const;

declare global {
  interface UmbValueTypeMap {
    [MY_STATUS_VALUE_TYPE]: MyStatusValue;
  }
}
```

{% endcode %}

Export the constant from your package entry point so other packages can import and use it.

### Naming

Follow the pattern that matches your use case:

| Category                  | Pattern                         | Example                            |
| ------------------------- | ------------------------------- | ---------------------------------- |
| Primitive or basic value  | `My.ValueType.{Type}`           | `My.ValueType.Status`              |
| Domain — reference shapes | `My.ValueType.{Entity}.{Shape}` | `My.ValueType.Category.References` |
| Property editor           | Property editor schema alias    | `My.PropertyEditor.Alias`          |

For property editors, always use the schema alias as the key. See [Property Editor Value Summary](/umbraco-cms/extend-your-project/backoffice-extensions/property-editors/property-editor-value-summary.md) for details on why.

## Use cases

Value types are used in these extension points:

{% content-ref url="/pages/CfTq2NNQNjVCwJPOiWXT" %}
[Value Summary](/umbraco-cms/extend-your-project/backoffice-extensions/extending-overview/extension-types/value-summary.md)
{% endcontent-ref %}

{% content-ref url="/pages/46n5THfxnrq8PNB4OHlW" %}
[Property Editor Value Summary](/umbraco-cms/extend-your-project/backoffice-extensions/property-editors/property-editor-value-summary.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.umbraco.com/umbraco-cms/extend-your-project/backoffice-extensions/extending-overview/extension-types/value-type.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
