> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Transition Component

## Article: Transition Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/animations/transition-component.md

## Article Content:

# Transition

_Components/Animations_

Interactive docs page: <https://wix-pages.com/design-system-documentation/#/component/transition>

## Overview

```jsx
() => {
  const [showMove, setShowMove] = React.useState(true);

  React.useEffect(() => {
    setTimeout(() => setShowMove((previous) => !previous), 1500);
  }, [showMove]);

  const renderContent = () => (
    <StorybookComponents.Placeholder width="240px" height="120px">
      Element with animated transition
    </StorybookComponents.Placeholder>
  );

  return (
    <Box height="120px" gap={4}>
      <Transition
        show={showMove}
        enterAnimation={{
          moveIn: {
            direction: 'rightToLeft',
            distance: '200%',
            duration: 'slow02',
          },
          fadeIn: {
            delay: 'short',
            duration: 'slow02',
          },
        }}
        exitAnimation={{
          moveOut: {
            direction: 'leftToRight',
            distance: '200%',
            duration: 'slow02',
          },
          fadeOut: {
            delay: 'short',
            duration: 'slow02',
          },
        }}
      >
        {renderContent()}
      </Transition>
    </Box>
  );
};
```

Transition is a wrapper that allows animations of other components.

### Do

- Use it to animate components that need a visual explanation of their origin or termination. For example tooltip appearance animation.
- Use it for animated transitions between object states to provide clarity of change.

### Don't

- Don't use it to animate interface elements for sake of effect.
- Don't use it for idle animations, like loading spinner.

### Feature examples

#### Enter Animation

Make component appear using these four animation types:

- `Fade In` - use it for sudden appearances or state changes.
- `Move In` - use it to emphasize direction from which object appears. It supports 4 possible directions.
- `Expand` - use it for objects that appear in between the content. It supports 4 possible directions.
- `ScaleUp `- use it to explain that object appears from a certain point. It supports 9 possible directions.

To see all possible direction options please check API.

```jsx
() => {
  const [showFade, setShowFade] = React.useState(false);
  const [showMove, setShowMove] = React.useState(false);
  const [showExpand, setShowExpand] = React.useState(false);
  const [showScaleUp, setShowScaleUp] = React.useState(false);

  return (
    <StorybookComponents.Stack height={200}>
      <StorybookComponents.Stack flexDirection="column" width="25%">
        <StorybookComponents.Stack
          flexDirection="column"
          width="80px"
          gap="6px"
        >
          fadeIn
          <Button onClick={() => setShowFade(!showFade)}>
            {showFade ? 'Reset' : 'Play'}
          </Button>
        </StorybookComponents.Stack>
        <Transition
          show={showFade}
          enterAnimation={{
            fadeIn: {
              duration: 'slow02',
              easing: 'enterEasing',
            },
          }}
        >
          <StorybookComponents.Placeholder height="100px" width="100px" />
        </Transition>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack flexDirection="column" width="25%">
        <StorybookComponents.Stack
          flexDirection="column"
          width="80px"
          gap="6px"
        >
          moveIn
          <Button onClick={() => setShowMove(!showMove)}>
            {showMove ? 'Reset' : 'Play'}
          </Button>
        </StorybookComponents.Stack>
        <Transition
          show={showMove}
          enterAnimation={{
            moveIn: {
              direction: 'bottomToTop',
              distance: '20px',
              duration: 'slow02',
              easing: 'enterEasing',
            },
          }}
        >
          <StorybookComponents.Placeholder height="100px" width="100px" />
        </Transition>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack flexDirection="column" width="25%">
        <StorybookComponents.Stack
          flexDirection="column"
          width="80px"
          gap="6px"
        >
          expand
          <Button onClick={() => setShowExpand(!showExpand)}>
            {showExpand ? 'Reset' : 'Play'}
          </Button>
        </StorybookComponents.Stack>
        <Transition
          show={showExpand}
          enterAnimation={{
            expand: {
              direction: 'bottomToTop',
              duration: 'slow02',
              easing: 'enterEasing',
            },
          }}
        >
          <StorybookComponents.Placeholder height="100px" width="100px" />
        </Transition>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack flexDirection="column">
        <StorybookComponents.Stack
          flexDirection="column"
          width="80px"
          gap="6px"
        >
          scaleUp
          <Button onClick={() => setShowScaleUp(!showScaleUp)}>
            {showScaleUp ? 'Reset' : 'Play'}
          </Button>
        </StorybookComponents.Stack>
        <Transition
          show={showScaleUp}
          enterAnimation={{
            scaleUp: {
              direction: 'bottom',
              duration: 'slow02',
              easing: 'enterEasing',
              scale: '100%',
            },
          }}
        >
          <StorybookComponents.Placeholder height="100px" width="100px" />
        </Transition>
      </StorybookComponents.Stack>
    </StorybookComponents.Stack>
  );
};
```

#### Exit Animation

Make components disappear using these four animation types:

- `Fade Out` - use it for appearances or state changes.
- `Move Out` - use it to emphasize the direction to which object disappears. It supports 4 possible directions.
- `Collapse` - use it for objects that disappear in between the content. It supports 4 possible directions.
- `ScaleDown` - use it to explain that an object disappears to a certain point. It supports 9 possible directions.

To see all possible direction options please check API.

```jsx
() => {
  const [showFade, setShowFade] = React.useState(true);
  const [showMove, setShowMove] = React.useState(true);
  const [showCollapse, setShowCollapse] = React.useState(true);
  const [showScaleDown, setShowScaleDown] = React.useState(true);

  return (
    <StorybookComponents.Stack height={200}>
      <StorybookComponents.Stack flexDirection="column" width="25%">
        <StorybookComponents.Stack
          flexDirection="column"
          width="80px"
          gap="6px"
        >
          fadeOut
          <Button onClick={() => setShowFade(!showFade)}>
            {showFade ? 'Play' : 'Reset'}
          </Button>
        </StorybookComponents.Stack>
        <Transition
          show={showFade}
          exitAnimation={{
            fadeOut: {
              duration: 'slow02',
              easing: 'exitEasing',
            },
          }}
        >
          <StorybookComponents.Placeholder height="100px" width="100px" />
        </Transition>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack flexDirection="column" width="25%">
        <StorybookComponents.Stack
          flexDirection="column"
          width="80px"
          gap="6px"
        >
          moveOut
          <Button onClick={() => setShowMove(!showMove)}>
            {showMove ? 'Play' : 'Reset'}
          </Button>
        </StorybookComponents.Stack>
        <Transition
          show={showMove}
          exitAnimation={{
            moveOut: {
              direction: 'bottomToTop',
              distance: '50px',
              duration: 'slow02',
              easing: 'exitEasing',
            },
          }}
        >
          <StorybookComponents.Placeholder height="100px" width="100px" />
        </Transition>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack flexDirection="column" width="25%">
        <StorybookComponents.Stack
          flexDirection="column"
          width="80px"
          gap="6px"
        >
          collapse
          <Button onClick={() => setShowCollapse(!showCollapse)}>
            {showCollapse ? 'Play' : 'Reset'}
          </Button>
        </StorybookComponents.Stack>
        <Transition
          show={showCollapse}
          exitAnimation={{
            collapse: {
              direction: 'bottomToTop',
              duration: 'slow02',
              easing: 'exitEasing',
            },
          }}
        >
          <StorybookComponents.Placeholder height="100px" width="100px" />
        </Transition>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack flexDirection="column">
        <StorybookComponents.Stack
          flexDirection="column"
          width="80px"
          gap="6px"
        >
          scaleDown
          <Button onClick={() => setShowScaleDown(!showScaleDown)}>
            {showScaleDown ? 'Play' : 'Reset'}
          </Button>
        </StorybookComponents.Stack>
        <Transition
          show={showScaleDown}
          exitAnimation={{
            scaleDown: {
              direction: 'bottom',
              duration: 'slow02',
              easing: 'exitEasing',
              scale: '0%',
            },
          }}
        >
          <StorybookComponents.Placeholder height="100px" width="100px" />
        </Transition>
      </StorybookComponents.Stack>
    </StorybookComponents.Stack>
  );
};
```

#### Swoosh

The `swoosh` preset fades content in while it drifts and stretches in from one edge, and out the way it came. It pairs with layout components that slide into view, such as a side panel.

Set the same `direction` on the enter and exit animation so the content retreats toward the edge it entered from. The motion is skipped automatically when the user prefers reduced motion.

```jsx
() => {
  const [show, setShow] = React.useState(false);

  return (
    <Box direction="vertical" gap="12px" height="260px">
      <Box width="120px">
        <Button onClick={() => setShow(!show)}>
          {show ? 'Hide panel' : 'Show panel'}
        </Button>
      </Box>
      <Box height="180px">
        <Transition
          show={show}
          enterAnimation={{ swoosh: { direction: 'rightToLeft' } }}
          exitAnimation={{ swoosh: { direction: 'rightToLeft' } }}
        >
          <Card>
            <Card.Header
              title="Site settings"
              subtitle="Swooshes in from the right"
            />
          </Card>
        </Transition>
      </Box>
    </Box>
  );
};
```

#### Duration

Use it to determine how long animation plays. Choose form 6 following properties:

- `Fast01` - 100ms. Use for small objects such as Buttons or Toggles.
- `Fast02` - 150ms. Use for larger than small objects such as Tooltips or Section Helpers.
- `Medium01` - 200ms. Use for medium size objects like dropdowns or accordions.
- `Medium02` - 300ms. Use for greater than medium size objects like side panel or small modals.
- `Slow01` - 450ms. Use for larger objects like big modals or large collapsible content.
- `Slow02` - 600ms. Use for very large objects like page transitions.

```jsx
() => {
  const [showMove, setShowMove] = React.useState(true);

  const renderTransition = (duration) => {
    return (
      <StorybookComponents.Stack flexDirection="column" width="25%" gap="6px">
        {duration}
        <Transition
          show={showMove}
          enterAnimation={{}}
          exitAnimation={{
            moveOut: {
              direction: 'topToBottom',
              distance: '100px',
              duration,
              easing: 'standardEasing',
            },
          }}
        >
          <StorybookComponents.Placeholder height="60px" width="60px" />
        </Transition>
      </StorybookComponents.Stack>
    );
  };

  return (
    <StorybookComponents.Stack height={300} flexDirection="column">
      <StorybookComponents.Stack>
        <Button onClick={() => setShowMove(!showMove)}>
          {showMove ? 'Play' : 'Reset'}
        </Button>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack justifyContent="space-between">
        {renderTransition('fast01')}
        {renderTransition('fast02')}
        {renderTransition('medium01')}
        {renderTransition('medium02')}
        {renderTransition('slow01')}
        {renderTransition('slow02')}
      </StorybookComponents.Stack>
    </StorybookComponents.Stack>
  );
};
```

#### Easing

Use it to determine the velocity of the object's motion:

- `Enter Easing` - used for objects that appear on the screen during the enter animation.
- `Exit Easing` - used for objects that disappear from the screen during the exit animation.
- `Standard Easing` - used for objects that stay present on the screen during enter or exit animations. For example toggle switch.

```jsx
() => {
  const [showMove, setShowMove] = React.useState(true);

  const renderEasing = (easing) => (
    <StorybookComponents.Stack flexDirection="column" width="25%" gap="6px">
      {easing}
      <Transition
        show={showMove}
        exitAnimation={{
          moveOut: {
            direction: 'topToBottom',
            distance: '100%',
            duration: 'slow02',
            easing,
          },
        }}
      >
        <StorybookComponents.Placeholder height="60px" width="60px" />
      </Transition>
    </StorybookComponents.Stack>
  );

  return (
    <StorybookComponents.Stack flexDirection="column" height={300}>
      <StorybookComponents.Stack>
        <Button onClick={() => setShowMove(!showMove)}>
          {showMove ? 'Play' : 'Reset'}
        </Button>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack justifyContent="space-between">
        {renderEasing('enterEasing')}
        {renderEasing('exitEasing')}
        {renderEasing('standardEasing')}
      </StorybookComponents.Stack>
    </StorybookComponents.Stack>
  );
};
```

#### Delay

Use it to determine the time it takes for animation or next animation to start. There are three delay values:

- `Short` - 100ms.
- `Medium` - 150ms.
- `Long` - 200ms.

```jsx
() => {
  const [showMove, setShowMove] = React.useState(true);

  const renderTransition = (delay) => {
    return (
      <StorybookComponents.Stack flexDirection="column" width="25%" gap="6px">
        {delay}
        <Transition
          show={showMove}
          exitAnimation={{
            moveOut: {
              direction: 'topToBottom',
              distance: '100px',
              duration: 'slow02',
              delay,
              easing: 'standardEasing',
            },
          }}
        >
          <StorybookComponents.Placeholder height="60px" width="60px" />
        </Transition>
      </StorybookComponents.Stack>
    );
  };

  return (
    <StorybookComponents.Stack height={300} flexDirection="column">
      <StorybookComponents.Stack>
        <Button onClick={() => setShowMove(!showMove)}>
          {showMove ? 'Play' : 'Reset'}
        </Button>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack justifyContent="space-between">
        {renderTransition('short')}
        {renderTransition('medium')}
        {renderTransition('long')}
      </StorybookComponents.Stack>
    </StorybookComponents.Stack>
  );
};
```

### Common use case examples

#### Animating list items

Use Transition component in cases when new elements appear or disappear from a screen, like in this case when dismissing list items.

```jsx
() => {
  const [child, setChild] = React.useState([]);

  const handleRemove = (id) => {
    setChild((previous) => previous.filter((c) => c.id !== id));
  };

  const handleAddChild = () => {
    const id = new Date().getTime();
    const item = {
      id,
      node: (
        <TableListItem
          key={id}
          showDivider
          onClick={() => {
            handleRemove(id);
          }}
          options={[
            { value: <Text>Order {child.length}</Text>, align: 'left' },
            { value: <Text>2 minutes ago</Text>, align: 'center' },
            {
              value: (
                <TableActionCell
                  size="small"
                  primaryAction={{
                    text: 'Mark as fullfilled',
                    skin: 'inverted',
                    onClick: () => handleRemove(id),
                  }}
                />
              ),
            },
          ]}
        />
      ),
    };
    setChild([item, ...child]);
  };

  return (
    <Card hideOverflow>
      <Card.Header
        title="Your order waitlist"
        suffix={
          <Button
            size="small"
            prefixIcon={<Icons.AddSmall />}
            onClick={() => handleAddChild()}
          >
            Add new order
          </Button>
        }
      />
      <Card.Divider />
      <Box direction="vertical">
        <Transition
          enterAnimation={{
            fadeIn: {
              delay: 'long',
              duration: 'slow02',
              easing: 'enterEasing',
            },
            moveIn: {
              direction: 'bottomToTop',
              distance: '30px',
              duration: 'slow02',
              delay: 'long',
              easing: 'enterEasing',
            },
          }}
          exitAnimation={{
            fadeOut: {
              delay: 'long',
              duration: 'slow02',
              easing: 'exitEasing',
            },
            moveOut: {
              direction: 'leftToRight',
              distance: '30px',
              duration: 'slow02',
              delay: 'long',
              easing: 'exitEasing',
            },
          }}
        >
          {child.map((c) => c.node)}
        </Transition>
      </Box>
    </Card>
  );
};
```

## Code

```jsx
import { Transition } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `animateOnLoad` | `boolean` | — | Shows enter animation on component mount. |
| `children` | `ReactNode` | — | Allows to render any component as a child item. |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute to be used in the tests. |
| `enterAnimation` | `EnterAnimation` | — | Sets a type of animation that happens on enter animation. - fadeIn - ```javascript { delay?: 'short' \| 'medium' \| 'long'; duration: \| 'fast01' \| 'fast02' \| 'medium01' \| 'medium02' \| 'slow01' \| 'slow02'; easing?: 'enterEasing' \| 'standardEasing'; } ``` - moveIn - ```javascript { delay?: 'short' \| 'medium' \| 'long'; direction: \| 'topToBottom' \| 'bottomToTop' \| 'leftToRight' \| 'rightToLeft'; distance: string; duration: \| 'fast01' \| 'fast02' \| 'medium01' \| 'medium02' \| 'slow01' \| 'slow02'; easing?: 'enterEasing' \| 'standardEasing'; } ``` - expand - ```javascript { delay?: 'short' \| 'medium' \| 'long'; direction: \| 'topToBottom' \| 'bottomToTop' \| 'leftToRight' \| 'rightToLeft'; duration: \| 'fast01' \| 'fast02' \| 'medium01' \| 'medium02' \| 'slow01' \| 'slow02'; easing?: 'enterEasing' \| 'standardEasing'; } ``` - scaleUp - ```javascript { delay?: 'short' \| 'medium' \| 'long'; direction: \| 'center' \| 'top' \| 'topEnd' \| 'right' \| 'bottomEnd' \| 'bottom' \| 'bottomStart' \| 'left' \| 'topStart'; duration: \| 'fast01' \| 'fast02' \| 'medium01' \| 'medium02' \| 'slow01' \| 'slow02'; easing?: 'enterEasing' \| 'standardEasing'; scale: string; } ``` - swoosh - a preset that quickly fades the content in while it drifts and stretches in from one edge. Pairs with layout components like SidePanel. The motion is skipped when the user prefers reduced motion. ```javascript { delay?: 'short' \| 'medium' \| 'long'; direction?: \| 'topToBottom' \| 'bottomToTop' \| 'leftToRight' \| 'rightToLeft'; } ``` |
| `exitAnimation` | `ExitAnimation` | — | Sets a type of animation that happens on exit animation. - fadeOut - ```javascript { delay?: 'short' \| 'medium' \| 'long'; duration: \| 'fast01' \| 'fast02' \| 'medium01' \| 'medium02' \| 'slow01' \| 'slow02'; easing?: 'exitEasing' \| 'standardEasing'; } ``` - moveOut - ```javascript { delay?: 'short' \| 'medium' \| 'long'; direction: \| 'topToBottom' \| 'bottomToTop' \| 'leftToRight' \| 'rightToLeft'; distance: string; duration: \| 'fast01' \| 'fast02' \| 'medium01' \| 'medium02' \| 'slow01' \| 'slow02'; easing?: 'exitEasing' \| 'standardEasing' } ``` - collapse - ```javascript { delay?: 'short' \| 'medium' \| 'long'; direction: \| 'topToBottom' \| 'bottomToTop' \| 'leftToRight' \| 'rightToLeft'; duration: \| 'fast01' \| 'fast02' \| 'medium01' \| 'medium02' \| 'slow01' \| 'slow02'; easing?: 'exitEasing' \| 'standardEasing'; } ``` - scaleDown - ```javascript { delay?: 'short' \| 'medium' \| 'long'; direction: \| 'center' \| 'top' \| 'topEnd' \| 'right' \| 'bottomEnd' \| 'bottom' \| 'bottomStart' \| 'left' \| 'topStart'; duration: \| 'fast01' \| 'fast02' \| 'medium01' \| 'medium02' \| 'slow01' \| 'slow02'; easing?: 'exitEasing' \| 'standardEasing'; scale: string; } ``` - swoosh - a preset that quickly fades the content out while it drifts and squashes back toward one edge. Pass the same direction as the enter preset so the content retreats the way it came in. The motion is skipped when the user prefers reduced motion. ```javascript { delay?: 'short' \| 'medium' \| 'long'; direction?: \| 'topToBottom' \| 'bottomToTop' \| 'leftToRight' \| 'rightToLeft'; } ``` |
| `mountOnEnter` | `boolean` | — | Lazy-mounts the component. If false, the component mounts immediately. If true, it mounts on the first enter. |
| `onEnd` | `(animationTiming?: AnimationTiming \| undefined) => void` | — | Defines a callback function which is called immediately after the animation ends. animationTiming notes if the animation is enter or exit. |
| `onStart` | `(animationTiming?: AnimationTiming \| undefined) => void` | — | Defines a callback function which is called immediately after the animation starts. animationTiming notes if the animation is enter or exit. |
| `show` | `boolean` | — | Shows animation when set to true. |
| `unmountOnExit` | `boolean` | — | Unmounts the component after it finishes exiting. If false, the component stays mounted after exit. |

## Testkit

No testkit for this component — it doesn't expose a unidriver testkit.

## Changelog

- **1.340.0** (2026-10-21) — maintenance release, no component-specific changes
- **1.339.0** (2026-10-19) — maintenance release, no component-specific changes
- **1.338.0** (2026-10-15) — maintenance release, no component-specific changes
- **1.330.3** (2026-09-29) — maintenance release, no component-specific changes
- **1.330.0** (2026-09-28) — maintenance release, no component-specific changes
- **1.325.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.320.1** (2026-09-04) — maintenance release, no component-specific changes
- **1.318.0** (2026-08-28) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.304.0** (2026-07-24) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.266.0** (2026-04-07) — maintenance release, no component-specific changes
- **1.260.0** (2026-03-17) — maintenance release, no component-specific changes
- **1.188.0** (2025-05-12) — feat: add animation timing parameter to onStart and onEnd callbacks ([#14846](invalid-url))
- **1.165.0** (2025-02-27) — maintenance release, no component-specific changes
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.115.0** (2024-07-17) — maintenance release, no component-specific changes
- **1.108.0** (2024-06-03) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes