# Aligning and Positioning

The Popup enables you to align it to [components](https://www.telerik.com/kendo-angular-ui/components/popup/aligning-positioning#aligning-to-components) and [absolute points](https://www.telerik.com/kendo-angular-ui/components/popup/aligning-positioning#aligning-to-absolute-points) as well as to [control its position](https://www.telerik.com/kendo-angular-ui/components/popup/aligning-positioning#positioning) and [render a margin](https://www.telerik.com/kendo-angular-ui/components/popup/aligning-positioning#adding-a-margin).

## Aligning to Components

To align the Popup to a specific component, use the [`anchor`](https://www.telerik.com/kendo-angular-ui/components/popup/api/popupcomponent#anchor) property binding. The Popup opens next to the defined `anchor` component.

> If an `anchor` is not provided, the Popup will use the [`offset`](https://www.telerik.com/kendo-angular-ui/components/popup/api/popupcomponent#offset) property value.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/popup/aligning/components/source.txt)

## Aligning to Absolute Points

To align the Popup to a specific absolute point that is relative to the document, use the [`offset`](https://www.telerik.com/kendo-angular-ui/components/popup/api/popupcomponent#offset) property binding. The Popup opens next to the point and uses the specified [`popupAlign`](https://www.telerik.com/kendo-angular-ui/components/popup/api/popupcomponent#popupalign) configuration.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/popup/aligning/absolute-points/source.txt)

## Adding a Margin

The Popup adds the [`margin`](https://www.telerik.com/kendo-angular-ui/components/popup/api/popupcomponent#margin) value to the popup dimensions in pixels and leaves a blank space between the popup and the anchor.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/popup/aligning/adding-margin/source.txt)

## Positioning

Precise positioning lets you adapt the Popup to different UI patterns—a dropdown menu that opens below its trigger, a tooltip that appears to the right of an icon, or a context menu that anchors to the cursor position.

Use [`anchorAlign`](https://www.telerik.com/kendo-angular-ui/components/popup/api/popupcomponent#anchoralign) to pick which point on the anchor the Popup attaches to. Use [`popupAlign`](https://www.telerik.com/kendo-angular-ui/components/popup/api/popupcomponent#popupalign) to pick which point on the Popup connects to that anchor point. Both properties accept an `{ horizontal, vertical }` object:

| Key          | Accepted values                 |
| ------------ | ------------------------------- |
| `horizontal` | `'left'`, `'center'`, `'right'` |
| `vertical`   | `'top'`, `'center'`, `'bottom'` |

The Popup's `popupAlign` point is placed on the anchor's `anchorAlign` point. For example, an `anchorAlign` of `horizontal: 'left'` with a `popupAlign` of `horizontal: 'right'` opens the Popup to the left of its anchor.

The following demo lets you interactively explore all alignment combinations. Use the configuration panel at the top right corner of the demo.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/popup/aligning/positioning/source.txt)

## Suggested Links

* [API Index of the Popup](https://www.telerik.com/kendo-angular-ui/components/popup/api)
* [API Reference of the PopupComponent](https://www.telerik.com/kendo-angular-ui/components/popup/api/popupcomponent)
* [Troubleshooting `AnimationBuilder` Error in Standalone Components](https://www.telerik.com/kendo-angular-ui/components/troubleshooting/general-issues#when-i-try-to-load-a-kendo-ui-for-angular-component-in-a-standalone-component-an-error-occurs)
