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

Morph

Also called shape morphing or morphing animation

A transition where one shape smoothly changes its size, corners, and contents into another, like a small pill growing into a full card.

import { AnimatePresence, motion, MotionConfig } from 'motion/react';

const SIZE = { idle: 'h-9 w-30', timer: 'h-9 w-60', music: 'h-35 w-80' };
const RADIUS = { idle: 18, timer: 18, music: 32 };
type Activity = keyof typeof SIZE;

export function StatusIsland({ activity }: { activity: Activity }) {
  return (
    // reducedMotion='user' makes the size change instant for people who prefer less motion.
    <MotionConfig
      reducedMotion='user'
      transition={{ type: 'spring', bounce: 0.25, duration: 0.5 }}
    >
      {/* layout animates the new size; animating borderRadius keeps the corners round while it scales. */}
      <motion.div
        layout
        initial={false}
        animate={{ borderRadius: RADIUS[activity] }}
        className={`relative overflow-hidden bg-black text-white ${SIZE[activity]}`}
      >
        {/* The content fades separately, so text never stretches with the shape. */}
        <AnimatePresence mode='popLayout' initial={false}>
          <motion.div
            key={activity}
            layout
            initial={{ opacity: 0 }}
            animate={{ opacity: 1, transition: { delay: 0.1 } }}
            exit={{ opacity: 0, transition: { duration: 0.1 } }}
            className='flex size-full items-center gap-3 px-4 text-sm'
          >
            {activity === 'timer' && (
              <>
                <span>Focus</span>
                <span className='ml-auto text-orange-400 tabular-nums'>
                  24:59
                </span>
              </>
            )}
            {activity === 'music' && (
              <>
                <span className='size-16 shrink-0 rounded-xl bg-linear-to-br from-fuchsia-500 to-orange-400' />
                <span>
                  <span className='block font-medium'>Midnight City</span>
                  <span className='block text-white/60'>M83</span>
                </span>
              </>
            )}
          </motion.div>
        </AnimatePresence>
      </motion.div>
    </MotionConfig>
  );
}
Build a Dynamic Island–style status pill: a black 120×36px pill at the top of the screen that morphs into a 240×36px timer and then into a 320×140px music player card. Animate size and corner radius as one shape with a spring (bounce 0.25, about 500ms), fade the inner content in after the shape starts moving, and switch instantly when prefers-reduced-motion is set.

Paste into Layerwise or any AI coding tool.

What is Morph?

A morph treats two states as the same object. Instead of hiding a small element and showing a big one, the element itself stretches, changes its corner radius, and swaps its contents while it changes shape. Apple’s Dynamic Island is the best-known example: a small black pill that grows into a timer, a call screen, or a music player.

Use it when a compact control expands into something larger and back: a search icon opening into a search field, a floating button turning into a menu, a badge expanding into a message preview. Because the shape never disappears, people can tell the big version came from the small one.

In code, most interface morphs are layout animations: you change the element’s size in CSS and let a library like Motion animate the difference with transforms. Fade the inner content separately so text does not stretch, and animate the corner radius through Motion so the corners stay round while the shape scales. The word also covers SVG shape morphing, where one icon outline turns into another, such as a menu icon becoming an X.

Often confused with

Shared element transition
A shared element transition carries one element between two separate views. A morph reshapes one element in place.

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.

Continuity transition

A transition where one element keeps its identity as it changes role, like an “Add to cart” button that becomes a progress bar, then a checkmark.

Spring animation

An animation driven by simulated spring physics in place of a fixed duration and curve, so motion can overshoot, settle, and react naturally.

Text morph

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.

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
9:41

9:41

Saturday, October 25