---
url: /documentation/concepts/elements/restrictions.md
description: >-
  Control element interactions with restrictions such as pinning, removal,
  hiding, copying, and dragging in or out.
---

# Restrictions&#x20;

An element definition's `restrictions` property is an optional record of flags, restricting how the editor is allowed to interact with the defined element.

:::warning
Apply restrictions with extra care, as they can maneuver users into a corner (e.g. through elements which can be created but not removed).
:::

All restriction flags are optional booleans. They're mostly useful for elements that are not created through the editor but programmatically (via [default documents](../../../cookbook/default-document.md) or [post-creation hooks](../../../cookbook/modify-after-creation.md)), or that are only allowed in very narrow contexts.

## Available Restriction Flags

Flag | Default | Description
-|-|-
`pinToTop` | `false` | Whether to prevent other elements from being dragged/inserted above this element.
`pinToBottom` | `false` | Whether to prevent other elements from being dragged/inserted below this element.
`allowRemove` | `true` | Whether to allow the removal of this element. However, unless `allowRemoveAncestors` is enabled, the element can still be removed when its parent is removed.
`allowRemoveAncestors` | `true` | Whether to allow the removal of this element's ancestors.
`allowHide` | `true` | Whether to allow the toggling this element's visibility. However, unless `allowHideAncestors` is enabled, the element can still be hidden when its parent is hidden.
`allowHideAncestors` | `true` | Whether to allow the toggling of this element's ancestors' visibility.
`allowCopy` | `true` | Whether to allow copying/duplicating this element. However, unless `allowCopyAncestors` is enabled, the element can still be copied as part of copying/duplicating its parent.
`allowCopyAncestors` | `true` | Whether to allow copying/duplicating this element's ancestors.
`allowInsertChildren` | `true` | Whether to allow inserting new children into this element. Preventing insertion does explicitly *not* inhibit the ability to drag compatible items into this element.
`allowDragChildrenIn` | `true` | Whether to allow dragging children into this element.
`allowDragChildrenOut` | `true` | Whether to allow dragging children out of this element.
`allowDragOut` | `true` | Whether to allow dragging this element out of its parent.
