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

Continuity transition

Also called container transform or visual continuity

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.

import { useState } from 'react';
import { motion } from 'motion/react';

// One button, three shapes. Size and corner radius spring between them.
const SHAPE = {
  idle: { width: 180, height: 48, borderRadius: 24 },
  loading: { width: 180, height: 8, borderRadius: 4 },
  done: { width: 48, height: 48, borderRadius: 24 }
};

const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

export function AddToCartButton() {
  const [stage, setStage] = useState<keyof typeof SHAPE>('idle');
  const [added, setAdded] = useState(false);

  async function add() {
    setStage('loading');
    await wait(1000); // Stand-in for the cart request.
    setAdded(true);
    setStage('done');
    await wait(1200);
    setStage('idle');
  }

  return (
    // A fixed-height slot, so the page doesn't shift while the button changes shape.
    <div className='grid h-12 place-items-center'>
      <motion.button
        type='button'
        onClick={add}
        disabled={stage !== 'idle'}
        initial={false}
        animate={SHAPE[stage]}
        transition={{ type: 'spring', bounce: 0.2, duration: 0.4 }}
        className={`relative overflow-hidden text-sm font-medium text-white transition-colors ${stage === 'done' ? 'bg-emerald-500' : 'bg-blue-600'}`}
      >
        {stage === 'idle' && (added ? 'Added to cart' : 'Add to cart')}
        {stage === 'loading' && (
          <motion.span
            role='progressbar'
            aria-label='Adding to cart'
            initial={{ scaleX: 0 }}
            animate={{ scaleX: 1 }}
            transition={{ duration: 1, ease: 'linear' }}
            className='absolute inset-0 origin-left bg-white/70'
          />
        )}
        {stage === 'done' && '✓'}
      </motion.button>
      {/* Screen readers don't describe the shape change, so announce the result. */}
      <p aria-live='polite' className='sr-only'>
        {stage === 'done' ? 'Added to cart' : ''}
      </p>
    </div>
  );
}
Turn the “Add to cart” button into a continuity transition: on click, shrink it in place into an 8px-tall progress bar that fills over about 1 second, then morph it into a green 48px circle with a checkmark, hold for 1.2 seconds, and expand it back into a button that says “Added to cart”. Animate size and corner radius with a 400ms spring, announce “Added to cart” in an aria-live region, and disable the button while it works.

Paste into Layerwise or any AI coding tool.

What is Continuity transition?

A continuity transition keeps a single element on screen through a whole sequence of changes. The button you pressed stays where your eyes already are and turns into the loading state, then into the result. Nothing disappears and nothing new pops up somewhere else, so people never have to search for what happened.

Use it for actions with a few clear stages: Add to cart, Send, Pay, Upload, Follow. Material Design calls a related pattern a container transform, where a card or floating button expands into the screen it opens.

Make each stage readable on its own: the label, the progress, and the confirmation. Keep the element in the same position, change its size only as much as each stage needs, and leave the result up for a second or so before resetting. Announce the outcome in an aria-live region, because screen readers do not describe the shape change.

Often confused with

Morph
A morph is a single shape change. A continuity transition chains several, keeping one element on screen across the stages of a task.

Related terms

All terms

Morph

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

Loading state

The view a screen shows while its data is on the way, designed together with the outcomes that follow: loaded, empty, or error.

Micro-interaction

A small moment of feedback around a single action, like a heart that bursts when tapped or a copy icon that turns into a checkmark.

Optimistic UI

A pattern where the interface shows the result of an action right away, before the server confirms it, and rolls it back if the request fails.

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
Pink over-ear headphones on a pink background

Wireless headphones

$129

Add to cart