MCPcopy
hub / github.com/pmndrs/react-spring

github.com/pmndrs/react-spring @v10.1.2 sqlite

repository ↗ · DeepWiki ↗ · release v10.1.2 ↗
821 symbols 2,571 edges 416 files 88 documented · 11%
README

react-spring

A spring-physics first animation library giving you flexible tools to confidently cast your ideas

Chat on Discord

react-spring is a cross-platform spring-physics first animation library.

It's as simple as:

const styles = useSpring({
  from: {
    opacity: 0
  },
  to: {
    opacity: 1
  }
})

<animated.div style={styles} />

Just a small bit about us:

  • Cross-Platform: We support react-dom, react-native, react-three-fiber, react-konva & react-zdog.
  • Versatile: Be declarative with your animations or if you prefer, imperative.
  • Spring-Physics First: By default animation use springs for fluid interactivity, but we support durations with easings as well.

There's a lot more to be had! Give it a try and find out.

Getting Started

⚡️ Jump Start

# Install the entire library
npm install react-spring
# or just install your specific target (recommended)
npm install @react-spring/web
import { animated, useSpring } from '@react-spring/web'

const FadeIn = ({ isVisible, children }) => {
  const styles = useSpring({
    opacity: isVisible ? 1 : 0,
    y: isVisible ? 0 : 24,
  })

  return <animated.div style={styles}>{children}</animated.div>
}

It's as simple as that to create scroll-in animations when value of isVisible is toggled.

📖 Documentation and Examples

More documentation on the project can be found here.

Pages contain their own examples which you can check out there, or open in codesandbox for a more in-depth view!


📣 What others say

Used by

And many others...

Backers

Thank you to all our backers! 🙏 If you want to join them here, then consider contributing to our Opencollective.

Contributors

This project exists thanks to all the people who contribute.

Extension points exported contracts — how you extend this code

Readable (Interface)
(no doc) [3 implementers]
packages/core/src/types/internal.ts
EasingDictionary (Interface)
* With thanks to ai easings.net * https://github.com/ai/easings.net/blob/master/src/easings/easingsFunctions.ts
packages/shared/src/easings.ts
RawPackage (Interface)
* Source of truth for the /examples page. * * Each sandbox lives at `demo/src/sandboxes/ /` with a `package.json`
docs/app/data/sandboxes.ts
InterpolatorFactory (Interface)
(no doc)
packages/types/src/interpolation.ts
BaseDemoProps (Interface)
(no doc)
packages/parallax/test/src/App.tsx
Options (Interface)
(no doc)
packages/mock-raf/index.d.ts
Queue (Interface)
(no doc)
packages/rafz/src/index.ts
HostConfig (Interface)
(no doc)
packages/animated/src/createHost.ts

Core symbols most depended-on inside this repo

get
called by 155
packages/core/src/types/internal.ts
start
called by 122
packages/core/src/SpringRef.ts
start
called by 74
packages/core/src/SpringValue.ts
step
called by 70
packages/mock-raf/index.d.ts
each
called by 58
packages/shared/src/helpers.ts
useSpring
called by 42
packages/core/src/hooks/useSpring.ts
set
called by 35
packages/core/src/SpringRef.ts
forEach
called by 34
packages/rafz/src/index.ts

Shape

Function 537
Method 121
Interface 115
Class 45
Enum 3

Languages

TypeScript100%

Modules by API surface

packages/core/src/SpringValue.ts40 symbols
packages/core/src/Controller.ts25 symbols
packages/rafz/src/index.ts21 symbols
packages/parallax/src/index.tsx20 symbols
packages/core/src/SpringValue.test.ts17 symbols
packages/core/src/FrameValue.ts16 symbols
packages/core/src/helpers.ts15 symbols
targets/web/src/AnimatedStyle.ts13 symbols
packages/core/src/SpringRef.ts13 symbols
packages/shared/src/fluids.ts12 symbols
packages/core/src/Interpolation.ts12 symbols
docs/scripts/docs/docs.ts12 symbols

Dependencies from manifests, versioned

@changesets/changelog-github0.7.0 · 1×
@changesets/cli2.31.0 · 1×
@codesandbox/sandpack-react2.20.0 · 1×
@commitlint/cli21.0.2 · 1×
@commitlint/config-conventional21.0.2 · 1×
@docsearch/css4.6.3 · 1×
@docsearch/react4.6.3 · 1×
@mdx-js/react3.1.1 · 1×
@mdx-js/rollup3.1.1 · 1×
@radix-ui/react-accordion1.2.12 · 1×
@radix-ui/react-dialog1.1.15 · 1×
@radix-ui/react-popover1.1.15 · 1×

For agents

$ claude mcp add react-spring \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact