Spring Pop In

Elastic scale-in wrapper for any element

Installation

$ pnpm dlx shadcn@latest add @remocn/spring-pop-in

Usage

// src/Root.tsx
import { Composition } from "remotion";
import { SpringPopIn } from "@/components/remocn/spring-pop-in";

const SpringPopInScene = () => (
  <SpringPopIn damping={12}>
    <div style={{ padding: 24, background: "#111", color: "white" }}>
      Hello
    </div>
  </SpringPopIn>
);

export const RemotionRoot = () => (
  <Composition
    id="SpringPopIn"
    component={SpringPopInScene}
    durationInFrames={60}
    fps={30}
    width={1280}
    height={720}
  />
);

Props

PropTypeDefaultDescription
childrenrequired
ReactNodeElement(s) to animate
damping
number12Spring damping. Lower = more bounce.
mass
number1Spring mass
stiffness
number100Spring stiffness
delayInFrames
number0Delay before the spring starts, in frames
className
stringOptional className passed to the outer container