# Custom Components

Custom Components — Legend Motion documentation.

Source: https://legend.so/motion/v2/usage/custom-components/

Legend Motion v2 documentation. Current documentation version.

While Legend-Motion provides animated wrappers around built-in components, you may want to create animated versions of custom components.

`createMotionComponent` is the function that adds the `animate` and `transition` properties and creates the animation logic. You can use it to convert your own components to Motion components.

As an example:

```js
import { createMotionComponent } from "@legendapp/motion";
import { Animated } from "react-native";

const AnimatedView = createMotionComponent(Animated.View);
```

For components that are not already animated, `createMotionAnimatedComponent(Component)` is shorthand for `createMotionComponent(Animated.createAnimatedComponent(Component))`. Import it from `@legendapp/motion`.

[View Markdown](https://legend.so/motion/v2/usage/custom-components.md)[Report a documentation correction](https://github.com/LegendApp/legend-docs/issues/new?title=Docs%3A+Custom+Components&body=Page%3A+https%3A%2F%2Flegend.so%2Fmotion%2Fv2%2Fusage%2Fcustom-components%0A%0AWhat+is+incorrect+or+missing%3F%0A%0AExpected+behavior+or+supporting+source%3A%0A)
