MCPcopy Index your code
hub / github.com/LegendApp/legend-motion

github.com/LegendApp/legend-motion @v2.5.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.5.3 ↗ · + Follow
26 symbols 64 edges 34 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Legend-Motion

Legend-Motion is a declarative animations library for React Native, to make it easy to transition between styles without needing to manage animations.

npm install @legendapp/motion or yarn add @legendapp/motion

import { Motion } from "@legendapp/motion"

<Motion.View
    initial={{ y: -50 }}
    animate={{ x: value * 100, y: 0 }}
    whileHover={{ scale: 1.2 }}
    whileTap={{ y: 20 }}
    transition={{ type: 'spring' }}
/>

Highlights

  • ✨ Supports react-native and react-native-web
  • ✨ API similar to Framer Motion for easy mixing of React Native with React
  • ✨ Supports animating SVG and linear gradient
  • ✨ Supports transformOrigin
  • ✨ whileHover and whileTap for easy animations on touch
  • ✨ AnimatePresence for exit animations
  • ✨ 0 dependencies using the built-in Animated
  • ✨ Built for maximum performance
  • ✨ Strongly typed with TypeScript

📖 Docs

The full documentation with live examples is on our website.

Upgrading from 1.x

  • whileTap and whileHover props now require a Motion.Pressable ancestor, which it uses for tracking whether it's hovered or pressed. See the example.

👩‍⚖️ License

MIT


Legend-Motion is created and maintained by Jay Meistrich with Legend and Bravely.

<a href="https://www.legendapp.com"><img src="https://www.legendapp.com/img/LogoTextOnWhite.png" height="56" alt="Legend" /></a>
<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<a href="https://www.bravely.io"><img src="https://www.legendapp.com/img/bravely-logo.png" height="56" alt="Bravely" /></a>

Extension points exported contracts — how you extend this code

Props (Interface)
(no doc)
example/src/App.tsx
Props (Interface)
(no doc)
src/AnimatePresence.tsx
Loopable (Interface)
(no doc)
src/Interfaces.ts
AnimInfo (Interface)
(no doc)
src/createMotionComponent.tsx
MotionTransitionTween (Interface)
(no doc)
src/Interfaces.ts
MotionTransitionSpring (Interface)
(no doc)
src/Interfaces.ts
MotionComponentProps (Interface)
(no doc)
src/Interfaces.ts
PropsTransforms (Interface)
(no doc)
src/Interfaces.ts

Core symbols most depended-on inside this repo

createMotionAnimatedComponent
called by 16
src/createMotionComponent.tsx
createMotionComponent
called by 7
src/createMotionComponent.tsx
pointToXY
called by 6
src/LinearGradient.tsx
addKeysToSet
called by 5
src/createMotionComponent.tsx
update
called by 4
src/createMotionComponent.tsx
setLinearGradientComponent
called by 2
src/LinearGradient.tsx
computeOrigin
called by 2
src/useTransformOrigin.ts
useInterval
called by 1
example/src/App.tsx

Shape

Function 14
Interface 9
Class 2
Method 1

Languages

TypeScript100%

Modules by API surface

src/Interfaces.ts6 symbols
src/createMotionComponent.tsx5 symbols
src/LinearGradient.tsx5 symbols
src/AnimatePresence.tsx3 symbols
example/src/App.tsx3 symbols
src/useTransformOrigin.ts2 symbols
src/configureMotion.ts1 symbols
src/MotionPressable.tsx1 symbols

For agents

$ claude mcp add legend-motion \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact