---
name: "up.Layer.prototype.context"
area: "API"
kind: "Property"
parent: "up.Layer class"
visibility: "experimental"
url: "https://unpoly.com/api/up.Layer.prototype.context"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.Layer class](https://unpoly.com/api/up.Layer.md)</nav>

# up.Layer.prototype.context

**This feature is experimental**. Please [share](https://github.com/unpoly/unpoly/discussions) your experiences so we know what to keep or change.

This layer's [context](https://unpoly.com/learn/layer-context.md).

<nav aria-label="Guides">

- [Learn: Layer context](https://unpoly.com/learn/layer-context.md)

</nav>

## Example {#example}

You may access the context properties like a regular JavaScript object.

```js
let layer = up.layer.current
layer.context.message = 'Please select a contact'
console.log(layer.context) // logs "{ message: 'Please select a contact' }"
```

---

## Value {#value}

### context {#context}

The context object.

If no context has been set an empty object is returned.

Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)

