UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

Eldora UI/Fade Text

Text effects
1 of 25
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

25 versions·4 librariesCompare all text animations →

  • Fade Text
  • Text Animate
  • Text Gif
  • Blur In Text
  • Dock Text
  • Font Weight Text
  • Gradual Spacing Text
  • Letter Pull Up Text
  • Multi Direction Slide Text
  • Scale Letter Text
  • Seperate Away Text
  • Wavy Text
  • Word Pull Up Text
  • Ai Text Loading
  • Cradle Text
  • Plucked Text
  • Swoosh Text
  • Animated Gradient Text
  • Animated Shiny Text
  • Comic Text
  • Dia Text Reveal
  • Hyper Text
  • Kinetic Text
  • Line Shadow Text
  • Morphing Text

Fade Text

A combined fade text component with support for in, up, and down directions.

npx shadcn@latest add https://eldoraui.site/r/fade-text.json
Open in v0 Docs Repo
Library
Eldora UI
License
MIT
Stack
React · Tailwind CSS · animated
Packages
clsxmotion
Size
119 lines
Demo
From Eldora UI

Code

registry/eldoraui/fade-text.tsx

"use client"

import React from "react"
import clsx from "clsx"
import { motion } from "motion/react"

type FadeDirection = "in" | "up" | "down"

interface FadeTextProps {
  text?: string
  className?: string
  direction?: FadeDirection
  staggerDelay?: number
  wordDelay?: number
}

export const FadeText: React.FC<FadeTextProps> = ({
  text = "",
  className = "",
  direction = "in",
  staggerDelay = 0.15,
  wordDelay = 0.1,
}) => {
  // For "in" direction, we animate word by word
  if (direction === "in") {
    const words = text.split(" ")

    return (
      <motion.div
        initial="hidden"
        animate="visible"
        viewport={{ once: true }}
        variants={{
          hidden: {},
          visible: {
            transition: {
              staggerChildren: wordDelay,
            },
          },
        }}
      >
        <motion.h1
          className={clsx(
            "font-display text-center 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]",
            className
          )}
        >
          {words.map((word, i) => (
            <motion.span
              key={`${word}-${i}`}
              variants={{
                hidden: { opacity: 0 },
                visible: { opacity: 1 },
              }}
            >
              {word}{" "}
            </motion.span>
          ))}
        </motion.h1>
      </motion.div>
    )
  }

  // For "up" and "down" directions, we animate the entire text
  const animationVariants =
    direction === "up"
      ? {
          hidden: { opacity: 0, y: 20 },
          show: {
            opacity: 1,
            y: 0,
            transition: {
              type: "spring" as const,
              stiffness: 100,
              damping: 12,
              duration: 0.8,
            },
          },
        }
      : {
          hidden: { opacity: 0, y: -20 },
          show: {
            opacity: 1,
            y: 0,
            transition: {
              type: "spring" as const,
              stiffness: 100,
              damping: 12,
              duration: 0.8,
            },
          },
        }

  return (
    <motion.div
      initial="hidden"
      animate="show"
      viewport={{ once: true }}
      transition={{ delay: staggerDelay }}
    >
      <motion.h1
        className={clsx(
          "font-display text-center 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]",
          className
        )}
        variants={animationVariants}
      >
        {text}
      </motion.h1>
    </motion.div>
  )
}

More like this

Scroll Index

Kokonut UI·Text effects

Label

shadcn/ui·Inputs & forms

Scroll Float

React Bits·Text effectsMIT+

Ai Message

SmoothUI·Backgrounds

Ai Reasoning

SmoothUI·Media & 3D

Family Button

Cult UI·Buttons

Bubble Menu

React Bits·BackgroundsMIT+

Particle Text

React Bits·Text effectsMIT+

8-bit Health Bar

8bitcn·Feedback & loaders

8-bit Mana Bar

8bitcn·Feedback & loaders

8-bit Progress

8bitcn·Feedback & loaders

Drape Background

Kokonut UI·Backgrounds

Dock

Motion Primitives·Navigation

Progress

shadcn/ui·Feedback & loaders

8-bit Slider

8bitcn·Inputs & forms