# Axis Lock

You can use the [`DragTarget`](https://www.telerik.com/kendo-angular-ui-develop/components/utils/api/dragtargetdirective) directive to restrict the drag either to the `horizontal` or `vertical` axis. To implement the axis restriction, set the [`restrictByAxis`](https://www.telerik.com/kendo-angular-ui-develop/components/utils/api/dragtargetdirective#restrictbyaxis) property.

> Restriction by axis is only applicable when the drag [`mode`](https://www.telerik.com/kendo-angular-ui-develop/components/utils/api/dragtargetdirective#mode) is set to `auto`. In `manual` mode the developer has full control over the drag action.

The following example demonstrates locking the element to be dragged horizontally or vertically only.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/utils/draganddrop/axis/source.txt)

## Suggested Links

* [API Reference of the DragTarget](https://www.telerik.com/kendo-angular-ui-develop/components/utils/api/dragtargetdirective)
* [API Reference of the DropTarget](https://www.telerik.com/kendo-angular-ui-develop/components/utils/api/droptargetdirective)
