Eldora UI
Eldora UI
  1. Components
  2. Text Animations
  3. Word pull up

Word pull up

Text animation where entire words pull up into view.

WordPullUp

<WordPullUpdemo />

Installation

Install the following dependencies:

npm install framer-motion

Copy and paste the following code into your project.

import clsx from "clsx";
import { motion } from "framer-motion";

export function WordPullUp() {
  const container = {
    hidden: { opacity: 0 },
    show: {
      opacity: 1,
      transition: {
        staggerChildren: 0.2,
      },
    },
  };

  const item = {
    hidden: { y: 20, opacity: 0 },
    show: { y: 0, opacity: 1 },
  };

  const words = "Word Pull Up";
  return (
    <motion.h1
      variants={container}
      initial="hidden"
      animate="show"
      className={clsx(
            "text-center font-display font-bold drop-shadow-sm",
            "text-4xl md:text-5xl lg:text-6xl xl:text-7xl",
            "tracking-[-0.02em]",
            "md:leading-[4rem] lg:leading-[4.5rem] xl:leading-[5rem]"
          )}
    >
      {words.split(" ").map((word, i) => (
        <motion.span
          key={i}
          variants={item}
          style={{ display: "inline-block", paddingRight: "15px" }}
        >
          {word === "" ? <span>&nbsp;</span> : word}
        </motion.span>
      ))}
    </motion.h1>
  );
}

Update the import paths to match your project setup.

Built by karthikmudunuri. The source code is available on GitHub.