---
title: "Compare with motion/react"
description: "Each example below runs twice, with the same props and the same controls: solid-motion on the left and motion/react on the right. Change a control and both start over. The manual pages do the same for one feature at a time."
url: "https://opensource.rising.sh/solid-motion/docs/compare"
---

# Compare with motion/react

Each example below runs twice, with the same props and the same controls:
solid-motion on the left and `motion/react` on the right. Change a control and
both start over. The manual pages do the same for one feature at a time.

## Shared layout

A card and its open view share a `layoutId`. The open view grows out of the
card, and closing it shrinks it back into its slot. The backdrop enters and
leaves through `AnimatePresence`.

The [web page](https://opensource.rising.sh/solid-motion/docs/compare) shows a live demo here.

## Exit and layout together

Dismissing the front card plays its `exit` while the cards behind it animate to
their new depth. The depth comes from each card's index, so a change to the list
changes every card's target.

The [web page](https://opensource.rising.sh/solid-motion/docs/compare) shows a live demo here.

## Reorder

Drag a row. `Reorder.Group` calls `onReorder` with the new order, and the other
rows slide into the gap.

The [web page](https://opensource.rising.sh/solid-motion/docs/compare) shows a live demo here.

## Many elements

This mounts the same number of looping elements in each library, one library at
a time. It records how long the mount took and how evenly frames arrived over
the next two seconds, then removes the elements. The `motion/react` code is
loaded before the first run, so the download is not counted.

The [web page](https://opensource.rising.sh/solid-motion/docs/compare) shows a live demo here.

Mount time is the synchronous render: building the components and inserting the
elements. Frame times depend on the device and on what else the page is doing,
so run it a few times. A frame near 16.7 ms is a 60 Hz display keeping up.

Unmount is the time to remove the elements. solid-motion also stops their
animations, so it takes longer than `motion/react`.

[Architecture](https://opensource.rising.sh/solid-motion/docs/architecture.md#what-runs-off-the-main-thread) lists the
animations that keep running smoothly while the page is busy.

## What differs in the code

The components and props are the same. The differences follow from Solid:

| motion/react                        | solid-motion                                  |
| ----------------------------------- | --------------------------------------------- |
| `className`                         | `class`                                       |
| `useMotionValue`, `useTransform`    | `createMotionValue`, `createTransform`        |
| `useScroll`, `useInView`            | `createScroll`, `createInView`                |
| `useAnimate`, `useDragControls`     | `createAnimate`, `createDragControls`         |
| `<AnimatePresence>{open && …}`      | `<AnimatePresence when={open()}>{() => …}`    |
| `<AnimatePresence>` around a `.map` | `<AnimatePresenceList each={…} getKey={…}>`   |
| `key` on each child                 | `<For>`, or `getKey` on `AnimatePresenceList` |

[Presence](https://opensource.rising.sh/solid-motion/docs/presence.md) explains `when` and `AnimatePresenceList`.

The manual's pages are listed in [llms.txt](https://opensource.rising.sh/solid-motion/llms.txt).
