Morphing text
Words that melt into one another.
Add it to your project
With the Magic UI commandTerminal
npx shadcn@latest add @magicui/morphing-text
First time with Magic UI? Set it up once.
The code
"use client"
import { useCallback, useEffect, useRef } from "react"
import { cn } from "@/lib/utils"
const morphTime = 1.5
const cooldownTime = 0.5
const useMorphingText = (texts: string[]) => {
const textIndexRef = useRef(0)
const morphRef = useRef(0)This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.