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

Frame rate (FPS)

Also called FPS or frames per second

The number of frames a screen draws each second; around 60 fps, motion looks smooth, and at lower rates it starts to look choppy.

import { useEffect, useState } from 'react';

function fpsColor(fps: number) {
  if (fps >= 55) return 'text-emerald-400';
  if (fps >= 30) return 'text-amber-400';
  return 'text-red-400';
}

// Render it in development only: {import.meta.env.DEV && <FpsMeter />}
export function FpsMeter() {
  const [fps, setFps] = useState<number | null>(null);

  useEffect(() => {
    let frames = 0;
    let start = performance.now();
    let frameId = 0;

    // requestAnimationFrame runs once per frame the browser draws.
    function tick(now: number) {
      frames += 1;
      if (now - start >= 500) {
        setFps(Math.round((frames * 1000) / (now - start)));
        frames = 0;
        start = now;
      }
      frameId = requestAnimationFrame(tick);
    }

    frameId = requestAnimationFrame(tick);
    return () => cancelAnimationFrame(frameId);
  }, []);

  return (
    <output
      className={`fixed right-3 bottom-3 rounded-md bg-black/80 px-2 py-1 font-mono text-xs tabular-nums ${fps === null ? 'text-white/60' : fpsColor(fps)}`}
    >
      {fps ?? '--'} fps
    </output>
  );
}
Add a small FPS meter to the corner of the page in development only: count frames with requestAnimationFrame, update the number every 500ms, and color it green at 55 fps or more, amber from 30 to 54, and red below 30.

Paste into Layerwise or any AI coding tool.

What is Frame rate (FPS)?

Motion on a screen is a quick series of still pictures called frames. Frame rate, measured in frames per second (fps), is how many of those pictures appear each second. More frames mean smaller jumps between them, so movement reads as one continuous glide. At 15 fps the same movement looks like a flip book.

Most screens refresh 60 times a second, and many phones and laptops run at 90 or 120. The browser tries to draw one frame per refresh, which leaves about 16.7ms per frame at 60Hz, or 8.3ms at 120Hz, for your JavaScript, style, layout, and painting.

Base JavaScript animation on elapsed time with requestAnimationFrame, so it moves at the same speed at any frame rate. Animate transform and opacity when you can, and check real numbers with the Performance panel or the Frame Rendering Stats overlay in Chrome DevTools, ideally on a mid-range phone.

Often confused with

Stepped animation
A stepped animation jumps between a few positions on purpose with steps(). A low frame rate makes every animation choppy by accident.

Related terms

All terms

Jank

Visible stutter in an animation or scroll, caused when the browser misses frames because it cannot finish its work in time.

GPU acceleration

A browser technique where the graphics chip moves, fades, or scales an element on its own layer instead of redrawing the page every frame.

Stepped animation

An animation that jumps through a set number of frames instead of moving smoothly, made with the CSS steps() timing function.

Perceived performance

How fast an app feels to people, which skeleton screens, instant feedback, and progressive loading can improve even when the real wait stays the same.

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

60 fps

30 fps

15 fps