# Bounding Box Constraint

**Input Shape** - connect the Shape to sample its bounding box.

**Width** - a value of -100 will set pinning to the left of your shape’s bounding box. A value of 100 will set it to the right

**Height** - a value of -100 will set pinning to the bottom of your shape’s bounding box. A value of 100 will set it to the top

**Offset** - add/subtract values \[x, y] to the output.

**Out Position** \[read only] - shows the \[x, y] values being output by the Element. Where the Id connection combines both the x and y positions this attribute allows you to connect the separate \[x, y] attributes to other Elements.

{% hint style="info" %}
Example usage:

1. Create 2 [Shapes](https://scenegroup.gitbook.io/cavalry/nodes/shapes/basic-shape).
2. Create a **Bounding Box Constraint**.
3. Connect ***shape1.id > boundingBoxConstraint.inputShape***
4. Connect ***boundingBoxConstraint.id > shape2.position***

**Shape 2** will be constrained to the bounding box of **Shape 1** depending on the **Area** setting on the **Bounding Box Constraint**
{% endhint %}
