> For the complete documentation index, see [llms.txt](https://intercode.gitbook.io/intercode-saas-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://intercode.gitbook.io/intercode-saas-kit/animation-and-styles/framer-motion.md).

# Framer Motion

### Credits

All the base examples of the animations and overall how this work you can find on their official documentation [here](https://www.framer.com/motion/).

In this block we just briefly take a look how this animation set in our project.

### Requirement

First of all we need to install package:&#x20;

```json
"framer-motion": "^11.3.2",
```

### Example

In file we import:

```javascript
import { AnimatePresence, motion } from 'framer-motion';
```

{% hint style="warning" %}
N.B. AnimatePresence not always necessary.
{% endhint %}

Base usage on example in Lead Statuses Settings:

```javascript
<motion.div key="edit" {...statusesForm} className="tour-statuses-list">
        <DndContext sensors={sensors} collisionDetection={closestCorners} onDragEnd={handleDragEnd}>
                <StatusesList statuses={statuses} />
        </DndContext>
</motion.div>
```

or more complicated example just lower in the code:

```javascript
<AnimatePresence mode="wait">
                {mode === 'edit' && (
                    <motion.div key="edit" {...statusesForm}>
                        <EditStatus
                            t={t}
                            statuses={statuses}
                            colors={colors}
                            handleUpdateStatus={handleUpdateStatus}
                            handleOpenDeleteModal={handleOpenDeleteModal}
                            loading={loading}
                        />
                    </motion.div>
                )}
                {mode === 'add' && (
                    <motion.div key="add" {...statusesForm}>
                        <AddStatus t={t} colors={colors} handleCreateStatus={handleCreateStatus} loading={loading} />
                    </motion.div>
                )}
</AnimatePresence>
```

From this example we can understand that render switches on display based on different conditions. Animation make experience of UI usage more smooth.

### Helpers

You may notice this thing in component code:

```javascript
{...statusesForm}
```

Such code you can find in ***.../ui/src/common/animationVariants/***

As you can see, in that folder we stores other animation variants.

Just go there and try it!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://intercode.gitbook.io/intercode-saas-kit/animation-and-styles/framer-motion.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
