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

Looping animation

Also called infinite animation or animation-iteration-count

An animation that plays more than once, either a set number of times or forever, set in CSS with animation-iteration-count.

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

export function InboxHeader({
  syncing,
  latestMessageId
}: {
  syncing: boolean;
  latestMessageId: string;
}) {
  const reduceMotion = useReducedMotion();

  return (
    <header className='flex items-center justify-between border-b px-4 py-3'>
      <h2 className='font-semibold'>Inbox</h2>
      <div className='flex items-center gap-3'>
        {syncing && (
          <motion.span
            role='status'
            aria-label='Syncing'
            // repeat: Infinity spins for as long as the sync runs.
            animate={reduceMotion ? undefined : { rotate: 360 }}
            transition={{ duration: 0.8, ease: 'linear', repeat: Infinity }}
            className='size-4 rounded-full border-2 border-muted border-t-foreground'
          />
        )}
        <motion.span
          // A new message id remounts the bell, which replays the ring.
          key={latestMessageId}
          // repeat: 2 adds two runs to the first, so it rings three times.
          animate={reduceMotion ? undefined : { rotate: [0, 12, -12, 0] }}
          transition={{ duration: 0.6, ease: 'easeInOut', repeat: 2 }}
          className='origin-top'
          aria-hidden
        >
          <svg
            viewBox='0 0 24 24'
            fill='none'
            stroke='currentColor'
            strokeWidth={2}
            className='size-5'
          >
            <path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9' />
            <path d='M10.3 21a1.94 1.94 0 0 0 3.4 0' />
          </svg>
        </motion.span>
      </div>
    </header>
  );
}
Make the notification bell ring three times when a new message arrives, using a 600ms wiggle with animation-iteration-count: 3, then stop. Keep the loading spinner rotating forever at 800ms per turn with linear easing. Stop both animations when prefers-reduced-motion is set.

Paste into Layerwise or any AI coding tool.

What is Looping animation?

A looping animation repeats instead of stopping after one run. In CSS, animation-iteration-count sets how many times it plays: 1 by default, a number such as 3, or infinite. Motion for React uses a repeat option that counts the extra runs, so repeat: 2 plays three times in total and repeat: Infinity never stops.

Endless loops fit things that stand for ongoing work: spinners, skeleton shimmers, a pulsing live indicator. A small fixed count suits attention cues, such as a bell that rings three times when a message arrives and then rests.

Endless motion pulls the eye and can make some people feel unwell. Stop a loop once its job is done, pause it while it is off screen, and stop or slow it for people who prefer reduced motion. Accessibility guidelines (WCAG) ask for a way to pause motion that starts on its own and lasts more than five seconds.

Often confused with

Yoyo animation
A yoyo animation is a loop that reverses direction on every other run. A plain loop restarts from the beginning each time.

Related terms

All terms

Yoyo animation

A looping animation that plays forward and then backward, so it moves back and forth smoothly instead of jumping back to the start.

Spinner

A small looping animation, usually a rotating ring, that shows the app is busy with a short task of unknown length.

Pulse animation

A soft, repeating beat or expanding ring that draws the eye to a live status, a new notification, or something that needs attention.

Reduced motion

An operating system setting that asks apps to minimize movement, which websites detect with the prefers-reduced-motion media query.

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

1

3

infinite

∞