> For the complete documentation index, see [llms.txt](https://mandarineframework.gitbook.io/mandarine-ts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mandarineframework.gitbook.io/mandarine-ts/mandarine-core/properties/the-value-decorator.md).

# The @Value Decorator

{% hint style="info" %}
This article requires knowledge of [Properties](https://mandarineframework.gitbook.io/mandarine-ts/mandarine-core/properties#setting-your-own-properties)
{% endhint %}

## Main

The `@Value` decorator allows you to access properties from your *properties.json* in a programatic way, this means, by using the `@Value` decorator, you can interact with your configuration in your components or native classes.

## Usage

**Syntax:**

```typescript
@Value(propertyKey: string)
```

* propertyKey
  * Key reference of your property. If nested, please separate by using dots (.)

Example:

{% tabs %}
{% tab title="properties.json" %}

```javascript
// ./src/main/resources/properties.json

{
    "mandarine": {
        "hello-message": "Bonjour!"
    },
    "customKey": "Here goes my custom value"
}
```

{% endtab %}

{% tab title="Test" %}

```typescript
import { Value } from "https://deno.land/x/mandarinets/mod.ts";

export class ValueDecoratorTest {

    @Value('customKey')
    public static customKey: string;
    
    @Value('mandarine.hello-message')
    public bonjour: string;

}

console.log(ValueDecoratorTest.customKey); // Here goes my custom value
console.log(new ValueDecoratorTest().bonjour); // Bonjour!
```

{% endtab %}
{% endtabs %}

In the example above we can see how we are using `@Value` on top of two different class fields: one that is static, and one that is not. Although, it works for both.

In the example above, we can also see how we are using *nested properties* with the `@Value` decorator.
