---
title: "Bindings"
description: "Assigning expressions to properties."
---

A binding assigns an [expression](../expressions/) to a [property](../properties/#sls.prop.def) of the element in whose body it appears.
It has the form of a property name, followed by `:`, an expression, and `;`.

```slint
export component Example inherits Window {
    Rectangle {
        background: #2a6e3f;
    }
}
```

The name shall refer to a property of the enclosing element.

An expression whose type is not the type of the property binds to it only when a conversion applies.

The type of the expression shall be the type of the property, or [convert](#sls.type.conversions) to it.

Setting the property replaces its binding with the set value.

A binding can also hold a [code block](../statements/),
and the [`<=>` operator](../two-way-bindings/) links two properties.