## Use Barriers to align elements that dynamically vary in size
Similar to a guideline, a barrier is an invisible line that you can constrain views to. Except a barrier does not define its own position; instead, the barrier position moves based on the position of views contained within it. This is useful when you want to constrain a view to the a set of views rather than to one specific view.
Barriers allow you to specify a constraint based on multiple UI elements. You'll want to use barriers any time that multiple elements could dynamically change their size based on user input or language.
Add **vertical barrier** (or **horizontal**) and in the **Component tree** select the elements to be aligned. Drag both onto your barrier in the Component Tree. Then select barrier in the component tree and open Attributes to set the desired direction. Then drag a constraint to the barrier