# motion

```ts
import { MotionModule } from '@anguless/angulux/motion';
```

## Motion

`agl-motion` — component

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

Motion component is a container to apply motion effects to its content.

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `visible` | `boolean` | _not documented_ | Whether the element is visible or not. |
| `mountOnEnter` | `boolean` | _not documented_ | Whether to mount the element on enter. |
| `unmountOnLeave` | `boolean` | _not documented_ | Whether to unmount the element on leave. |
| `name` | `MotionOptions['name']` | _not documented_ | The name of the motion. It can be a predefined motion name or a custom one. phases:     [name]-enter     [name]-enter-active     [name]-enter-to     [name]-leave     [name]-leave-active     [name]-leave-to |
| `type` | `MotionOptions['type']` | _not documented_ | The type of the motion, valid values 'transition' and 'animation'. |
| `safe` | `MotionOptions['safe']` | _not documented_ | Whether the motion is safe. |
| `disabled` | `MotionOptions['disabled']` | _not documented_ | Whether the motion is disabled. |
| `appear` | `MotionOptions['appear']` | _not documented_ | Whether the motion should appear. |
| `enter` | `MotionOptions['enter']` | _not documented_ | Whether the motion should enter. |
| `leave` | `MotionOptions['leave']` | _not documented_ | Whether the motion should leave. |
| `duration` | `MotionOptions['duration']` | _not documented_ | The duration of the motion. |
| `hideStrategy` | `'display' \| 'visibility'` | _not documented_ | The hide strategy of the motion, valid values 'display' and 'visibility'. |
| `enterFromClass` | `ClassNameOptions['from']` | _not documented_ | The enter from class of the motion. |
| `enterToClass` | `ClassNameOptions['to']` | _not documented_ | The enter to class of the motion. |
| `enterActiveClass` | `ClassNameOptions['active']` | _not documented_ | The enter active class of the motion. |
| `leaveFromClass` | `ClassNameOptions['from']` | _not documented_ | The leave from class of the motion. |
| `leaveToClass` | `ClassNameOptions['to']` | _not documented_ | The leave to class of the motion. |
| `leaveActiveClass` | `ClassNameOptions['active']` | _not documented_ | The leave active class of the motion. |
| `options` | `MotionOptions` | _not documented_ | The motion options. |

| Output | Type | Description |
| --- | --- | --- |
| `onBeforeEnter` | `MotionEvent \| undefined` | Callback fired before the enter transition/animation starts. |
| `onEnter` | `MotionEvent \| undefined` | Callback fired when the enter transition/animation starts. |
| `onAfterEnter` | `MotionEvent \| undefined` | Callback fired after the enter transition/animation ends. |
| `onEnterCancelled` | `MotionEvent \| undefined` | Callback fired when the enter transition/animation is cancelled. |
| `onBeforeLeave` | `MotionEvent \| undefined` | Callback fired before the leave transition/animation starts. |
| `onLeave` | `MotionEvent \| undefined` | Callback fired when the leave transition/animation starts. |
| `onAfterLeave` | `MotionEvent \| undefined` | Callback fired after the leave transition/animation ends. |
| `onLeaveCancelled` | `MotionEvent \| undefined` | Callback fired when the leave transition/animation is cancelled. |

## MotionDirective

`[aglMotion]` — directive

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

Motion Directive is directive to apply motion effects to elements.

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `aglMotion` | `boolean` | _not documented_ | Whether the element is visible or not. _(property `visible`)_ |
| `aglMotionName` | `MotionOptions['name']` | _not documented_ | The name of the motion. It can be a predefined motion name or a custom one. phases:     [name]-enter     [name]-enter-active     [name]-enter-to     [name]-leave     [name]-leave-active     [name]-leave-to _(property `name`)_ |
| `aglMotionType` | `MotionOptions['type']` | _not documented_ | The type of the motion, valid values 'transition' and 'animation'. _(property `type`)_ |
| `aglMotionSafe` | `MotionOptions['safe']` | _not documented_ | Whether the motion is safe. _(property `safe`)_ |
| `aglMotionDisabled` | `MotionOptions['disabled']` | _not documented_ | Whether the motion is disabled. _(property `disabled`)_ |
| `aglMotionAppear` | `MotionOptions['appear']` | _not documented_ | Whether the motion should appear. _(property `appear`)_ |
| `aglMotionEnter` | `MotionOptions['enter']` | _not documented_ | Whether the motion should enter. _(property `enter`)_ |
| `aglMotionLeave` | `MotionOptions['leave']` | _not documented_ | Whether the motion should leave. _(property `leave`)_ |
| `aglMotionDuration` | `MotionOptions['duration']` | _not documented_ | The duration of the motion. _(property `duration`)_ |
| `aglMotionHideStrategy` | `'display' \| 'visibility'` | _not documented_ | The hide strategy of the motion, valid values 'display' and 'visibility'. _(property `hideStrategy`)_ |
| `aglMotionEnterFromClass` | `ClassNameOptions['from']` | _not documented_ | The enter from class of the motion. _(property `enterFromClass`)_ |
| `aglMotionEnterToClass` | `ClassNameOptions['to']` | _not documented_ | The enter to class of the motion. _(property `enterToClass`)_ |
| `aglMotionEnterActiveClass` | `ClassNameOptions['active']` | _not documented_ | The enter active class of the motion. _(property `enterActiveClass`)_ |
| `aglMotionLeaveFromClass` | `ClassNameOptions['from']` | _not documented_ | The leave from class of the motion. _(property `leaveFromClass`)_ |
| `aglMotionLeaveToClass` | `ClassNameOptions['to']` | _not documented_ | The leave to class of the motion. _(property `leaveToClass`)_ |
| `aglMotionLeaveActiveClass` | `ClassNameOptions['active']` | _not documented_ | The leave active class of the motion. _(property `leaveActiveClass`)_ |
| `aglMotionOptions` | `MotionOptions` | _not documented_ | The motion options. _(property `options`)_ |

| Output | Type | Description |
| --- | --- | --- |
| `aglMotionOnBeforeEnter` | `MotionEvent \| undefined` | Callback fired before the enter transition/animation starts. _(property `onBeforeEnter`)_ |
| `aglMotionOnEnter` | `MotionEvent \| undefined` | Callback fired when the enter transition/animation starts. _(property `onEnter`)_ |
| `aglMotionOnAfterEnter` | `MotionEvent \| undefined` | Callback fired after the enter transition/animation ends. _(property `onAfterEnter`)_ |
| `aglMotionOnEnterCancelled` | `MotionEvent \| undefined` | Callback fired when the enter transition/animation is cancelled. _(property `onEnterCancelled`)_ |
| `aglMotionOnBeforeLeave` | `MotionEvent \| undefined` | Callback fired before the leave transition/animation starts. _(property `onBeforeLeave`)_ |
| `aglMotionOnLeave` | `MotionEvent \| undefined` | Callback fired when the leave transition/animation starts. _(property `onLeave`)_ |
| `aglMotionOnAfterLeave` | `MotionEvent \| undefined` | Callback fired after the leave transition/animation ends. _(property `onAfterLeave`)_ |
| `aglMotionOnLeaveCancelled` | `MotionEvent \| undefined` | Callback fired when the leave transition/animation is cancelled. _(property `onLeaveCancelled`)_ |
