LayerwiseLayerwise
  • Features
  • Pricing
  • Templates
  • Docs
DownloadDownload
FeaturesPricingTemplatesDocsAI Website BuilderVibe CodingPersonal Software
DownloadDownload
  1. Glossary
  2. /
  3. Text effects

Text morph

Also called morphing text or text morphing

A text transition where the letters two words share slide to their new spots while the others fade out or in, so a label changes without a hard cut.

import { useState } from 'react';
import { AnimatePresence, motion, useReducedMotion } from 'motion/react';

const SPRING = { type: 'spring', duration: 0.4, bounce: 0 } as const;

// Key each letter by the letter plus how many times it has appeared,
// so the shared letters in "Deploy" and "Deployed" keep their identity.
function toLetters(label: string) {
  const seen: Record<string, number> = {};
  return [...label].map((char) => {
    seen[char] = (seen[char] ?? 0) + 1;
    return { char, key: `${char}-${seen[char]}` };
  });
}

export function DeployButton({ deploy }: { deploy: () => Promise<void> }) {
  const [label, setLabel] = useState('Deploy');
  const reduceMotion = useReducedMotion();
  const transition = reduceMotion ? { duration: 0 } : SPRING;

  async function onClick() {
    setLabel('Deploying');
    await deploy();
    setLabel('Deployed');
  }

  return (
    <button
      type='button'
      onClick={onClick}
      disabled={label === 'Deploying'}
      className='w-36 rounded-full bg-primary py-2.5 text-sm font-medium text-primary-foreground'
    >
      <span className='sr-only'>{label}</span>
      <span aria-hidden className='relative inline-flex'>
        <AnimatePresence mode='popLayout' initial={false}>
          {toLetters(label).map(({ char, key }) => (
            <motion.span
              key={key}
              layout='position'
              initial={{ opacity: 0 }}
              animate={{ opacity: 1 }}
              exit={{ opacity: 0 }}
              transition={transition}
            >
              {char}
            </motion.span>
          ))}
        </AnimatePresence>
      </span>
    </button>
  );
}
Animate the "Deploy" button label as a text morph when it changes to "Deploying" and "Deployed": render each letter in its own span keyed by the letter and how many times it has appeared so far, slide shared letters to their new positions with a 400ms spring, and fade removed letters out and new ones in. Give the button a fixed width, keep the full label readable by screen readers, and swap instantly when prefers-reduced-motion is set.

Paste into Layerwise or any AI coding tool.

What is Text morph?

When a label changes, a text morph compares the old and new words letter by letter. Letters that appear in both glide to their new positions, letters that are gone fade out, and new ones fade in. Turning "Deploy" into "Deployed" keeps the first six letters and fades in two; turning "Deployed" into "Redeploy" carries the final "e" and "d" across to the front.

It fits labels that change state in place: Save to Saved, Follow to Following, or a plan name switching with a toggle. Because most letters stay, people can tell the button is the same and only its wording changed.

Keep it quick, around 300 to 500ms, since people are waiting for the result. Animate only transform and opacity, give screen readers the whole label rather than the separate letters, and swap the text instantly when someone prefers reduced motion. A fixed button width, or a width that animates with the text, keeps nearby elements from jumping.

Often confused with

Crossfade
A crossfade fades the whole old label out while the new one fades in. A text morph keeps the shared letters on screen and moves them.
Morph
Morph usually means one shape or element smoothly turning into another. Text morph applies the idea to the letters of a word.

Related terms

All terms

Layout animation

An animation that smoothly moves and resizes elements when the layout changes, such as list items gliding to new spots after a sort or filter.

Rotating words

A headline where one word keeps changing in place, rolling or fading through a short list while the rest of the sentence stays put.

Number ticker

A number that animates to its new value, either counting through the values in between or rolling each digit into place like an odometer.

Shared element transition

A transition where an element from one view, like a thumbnail, travels and grows into its place in the next view, linking the two screens.

Build it with Layerwise

Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.

DownloadDownloadRead the docs
LayerwiseLayerwise

Build full-stack web apps in minutes with AI.

Product

  • Features
  • Pricing
  • Download
  • Templates

Solutions

  • AI Website Builder
  • Vibe Coding
  • Personal Software

Resources

  • Documentation
  • Changelog
  • Blog
  • Vibe Coding Glossary
  • llms.txt
  • llms-full.txt

Company

  • About
  • Contact

Legal

  • Privacy
  • Analytics Privacy
  • Terms
  • Security
  • Abuse

© 2026 Layerwise. All rights reserved.

Entrances & exits

  • Fade in
  • Slide in
  • Scale in
  • Pop in
  • Blur in
  • Reveal animation
  • Enter and exit animations

Timing & sequencing

  • Duration
  • Delay
  • Keyframes
  • Tweening
  • Stagger
  • Orchestration
  • Fill mode
  • Stepped animation
  • Looping animation
  • Yoyo animation

Easing

  • Easing
  • Linear easing
  • Ease-in
  • Ease-out
  • Ease-in-out
  • Cubic-bezier
  • Asymmetric easing
  • Overshoot easing

Springs & physics

  • Spring animation
  • Stiffness
  • Damping
  • Mass
  • Bounce
  • Velocity
  • Momentum
  • Interruptible animation
  • Rubber-banding

Transforms

  • Translate
  • Scale
  • Rotate
  • Skew
  • 3D flip
  • Perspective
  • Transform origin
  • Origin-aware animation

State transitions

  • Crossfade
  • Morph
  • Shared element transition
  • Layout animation
  • Height auto animation
  • Direction-aware transition
  • Continuity transition
  • Page transition
  • View Transitions API

Scroll effects

  • Scroll reveal
  • Scroll-driven animation
  • Parallax scrolling
  • Scrollytelling
  • Scroll pinning
  • Horizontal scroll section
  • Scroll progress bar
  • Scroll snap
  • Smooth scrolling

Interaction feedback

  • Hover effect
  • Press feedback
  • Ripple effect
  • Shake animation
  • Hold to confirm
  • Drag gesture
  • Drag to reorder
  • Swipe to dismiss
  • Pull to refresh
  • Magnetic button
  • Custom cursor
  • 3D tilt card
  • Spotlight card

Text effects

  • Typewriter effect
  • Text scramble
  • Split text animation
  • Text morph
  • Rotating words
  • Gradient text
  • Shimmer text
  • Number ticker
  • Tabular numbers
  • Underline animation

Loops & ambient motion

  • Marquee
  • Pulse animation
  • Float animation
  • Orbit animation
  • Idle animation
  • Particle background
  • Border beam
  • Confetti
  • Animated gradient

Visual effects

  • Blur
  • Clip-path
  • Mask
  • Before/after slider
  • SVG line drawing
  • Lottie animation

Motion principles

  • Purposeful animation
  • Anticipation
  • Follow-through
  • Squash and stretch
  • Perceived performance
  • Frequency of use
  • Spatial consistency
  • Reduced motion

Animation performance

  • Frame rate (FPS)
  • Jank
  • GPU acceleration
  • will-change
  • Layout thrashing

Layout

  • Hero section
  • Above the fold
  • Sticky header
  • Sidebar
  • Bento grid
  • Card
  • Flexbox
  • CSS Grid
  • Padding vs margin
  • Responsive design
  • Container
  • Masonry layout
  • Split screen
  • Z-index
  • Overflow

Components

  • Button variants
  • Modal
  • Drawer
  • Popover
  • Tooltip
  • Dropdown menu
  • Context menu
  • Toast notification
  • Tabs
  • Segmented control
  • Accordion
  • Carousel
  • Command palette
  • Combobox
  • Toggle switch
  • Checkbox
  • Radio button
  • Date picker
  • Breadcrumb
  • Pagination
  • Infinite scroll
  • Badge
  • Avatar stack
  • Empty state
  • Skeleton screen
  • Spinner
  • Progress bar
  • Data table
  • Stepper
  • Floating label
  • Inline validation
  • Alert banner
  • Tag input

States & patterns

  • Interaction states
  • Focus ring
  • Loading state
  • Optimistic UI
  • Debounce
  • Lazy loading
  • Dark mode
  • Micro-interaction
  • Affordance
  • Undo
  • Drag and drop
  • Keyboard shortcut

Visual styles

  • Glassmorphism
  • Liquid glass
  • Neumorphism
  • Claymorphism
  • Neo-brutalism
  • Skeuomorphism
  • Flat design
  • Mesh gradient
  • Aurora background
  • Grain texture
  • Glow effect
  • Drop shadow
  • Border radius
  • Grid background
  • Typographic hierarchy
  • Accent color
  • Color contrast

Vibe coding & AI

  • Vibe coding
  • Prompt
  • Context window
  • Token
  • AI agent
  • Tool call
  • Hallucination
  • Diff
  • Live preview
  • Checkpoint
  • Git commit
  • Deploy
  • Frontend and backend
  • API
  • Database
  • Rules file
  • MCP
  • Plan mode
  • Visual edit

Text morph

DeployDeploy

Plain swap

DeployDeploy