LayerwiseLayerwise
  • Features
  • Pricing
  • Templates
  • Docs
DownloadDownload
FeaturesPricingTemplatesDocsAI Website BuilderVibe CodingPersonal Software
DownloadDownload
  1. Glossary
  2. /
  3. Entrances & exits

Enter and exit animations

Also called exit animation or mount and unmount animation

The pair of animations an element plays as it is added to the page and as it is removed, so changes to a list or layout are easy to follow.

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

type NotificationItem = { id: string; title: string };

export function NotificationList({
  items,
  onDismiss
}: {
  items: NotificationItem[];
  onDismiss: (id: string) => void;
}) {
  const reduceMotion = useReducedMotion();

  return (
    <ul className='relative flex w-80 flex-col gap-2'>
      {/* popLayout lets the others glide into the gap while an item exits. */}
      <AnimatePresence initial={false} mode='popLayout'>
        {items.map((item) => (
          <motion.li
            key={item.id}
            layout={!reduceMotion}
            initial={{ opacity: 0, y: reduceMotion ? 0 : -12 }}
            animate={{ opacity: 1, y: 0, transition: { duration: 0.25 } }}
            // Exits are faster than entrances: the person has already moved on.
            exit={{
              opacity: 0,
              scale: reduceMotion ? 1 : 0.95,
              transition: { duration: 0.15 }
            }}
            className='flex items-center justify-between gap-3 rounded-xl border bg-background px-4 py-3 text-sm shadow-sm'
          >
            {item.title}
            <button
              type='button'
              aria-label='Dismiss'
              onClick={() => onDismiss(item.id)}
              className='rounded-md px-2 text-muted-foreground hover:bg-muted hover:text-foreground'
            >
              ×
            </button>
          </motion.li>
        ))}
      </AnimatePresence>
    </ul>
  );
}
Animate items in the notification list: new items fade in and slide down 12px over 250ms, removed items fade out and shrink to 0.95 over 150ms, and the remaining items move smoothly into the freed space. Use Motion’s AnimatePresence with layout animations, and use opacity-only fades when prefers-reduced-motion is set.

Paste into Layerwise or any AI coding tool.

Enter and exit animations explained

An enter animation plays when an element appears, such as a new row fading and sliding into a list. An exit animation plays when it leaves, such as a dismissed toast fading out before it is removed. Together they let people track what changed.

Exits are the harder half. Most frameworks remove an element from the page immediately, which leaves nothing to animate. In React, Motion’s AnimatePresence keeps a removed child on the page until its exit animation finishes. In plain CSS, @starting-style covers entrances, and exits work when the element is hidden with display: none and transition-behavior: allow-discrete.

Make exits faster than entrances, around 150 to 200ms against 250 to 300ms, since the person has already moved on. Let the remaining items glide into the gap with a layout animation, and use simple fades when someone prefers reduced motion.

Often confused with

Layout animation
A layout animation moves elements that change position or size. Enter and exit animations handle elements being added or removed, and the two often run together.

Related terms

All terms

Fade in

An entrance animation where an element goes from fully transparent to fully visible, so it appears gently instead of popping in.

Slide in

An entrance animation where an element moves into place from one side, often while fading in, so people see where it came from.

Toast notification

A brief message that slides into a corner of the screen to confirm an action, then disappears on its own after a few seconds.

Interruptible animation

An animation that can change course mid-flight, continuing smoothly from its current position and speed when someone acts again before it ends.

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
  • New commentMaya on Homepage
  • Invite acceptedLeo joined the team
  • Payment received$240 from Acme