# TransitionOptions

interface in `@dioramajs/diorama/transitions`

```ts
import type { TransitionOptions } from '@dioramajs/diorama/transitions'
```

Options of one `app.transition` call. Unset fields take the plugin options.

```ts
interface TransitionOptions extends Partial<FlightOptions & PresenceOptions>
```

## Members

| Name | Type | Description |
| --- | --- | --- |
| `animate?` | `(transition: Transition) => unknown` | Custom choreography, called when the flights start. Its result is awaited, so a GSAP timeline works. `leaving` and `entering` are only filled when `leave` or `enter` is above 0 or inside a browser view transition. Their durations then only matter if the transition is cut short. |
| `crossfade?` | `number` | Seconds a landed copy fades over the target's own copy or DOM. Default 0.25. |
| `duration?` | `number` | Seconds. Default 0.8. |
| `ease?` | `Ease` | Default cubic in-out. GSAP eases work too, e.g. `gsap.parseEase('expo.inOut')`. |
| `enter?` | `number` | Seconds new copies in view take to appear, as u.presence goes from 0 to 1. Their DOM waits at most 0.5 s. Default 0, or 0.25 inside a browser view transition. Under reduced motion the option is ignored, the default applies and the copy's opacity fades instead. |
| `leave?` | `number` | Seconds unpaired copies outlive their removed elements, as u.presence goes from 1 to 0. Default 0, or 0.25 inside a browser view transition. Under reduced motion the option is ignored, the default applies and the copy's opacity fades instead. |
| `signal?` | `AbortSignal` | On abort everything lands at once and the status is 'aborted'. The swap still runs. |
| `stagger?` | `number` | Seconds between flight starts, in document order of the targets. Default 0. |
| `timeout?` | `number` | Seconds to wait for a thenable swap or `animate` before giving up the flights. Default 10. |
| `url?` | `string \| URL` | URL of the new page for the page scope and events. Default `location.href` after the swap. |
| `viewTransition?` | `ViewTransition \| null` | The browser view transition the swap runs in, or null for none. When omitted, or when it is a router's look-alike object, it is detected with `:active-view-transition`. |
| `wait?` | `number` | Seconds a landed copy waits for the target's copy before giving way to the DOM. Default 2. |

Also exported from `@dioramajs/transitions`.

Defined in [packages/transitions/src/types.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/transitions/src/types.ts#L39).
