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

Loading state

Also called loading UI or loading indicator

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

type Message = { id: string; from: string; preview: string };

// Wire these to your data hook, such as React Query's useQuery.
type Props = {
  status: 'pending' | 'error' | 'success';
  messages?: Message[];
  onRetry: () => void;
};

export function MessagesCard({ status, messages = [], onRetry }: Props) {
  return (
    // A fixed height keeps the card from jumping between states.
    <section
      aria-busy={status === 'pending'}
      className='grid h-56 w-80 rounded-2xl border p-4 text-sm'
    >
      {status === 'pending' && (
        // Fades in after 200ms, so fast responses never flash a skeleton.
        <div className='space-y-4 transition-opacity delay-200 starting:opacity-0'>
          {[0, 1, 2].map((row) => (
            <div key={row} className='flex gap-3 motion-safe:animate-pulse'>
              <div className='size-10 rounded-full bg-muted' />
              <div className='h-10 flex-1 rounded-lg bg-muted' />
            </div>
          ))}
        </div>
      )}
      {status === 'error' && (
        <div className='place-self-center text-center'>
          <p>Couldn't load messages.</p>
          <button
            type='button'
            onClick={onRetry}
            className='mt-3 rounded-lg border px-3 py-1.5 font-medium hover:bg-muted'
          >
            Try again
          </button>
        </div>
      )}
      {status === 'success' && messages.length === 0 && (
        <div className='place-self-center text-center'>
          <p className='font-medium'>No messages yet</p>
          <p className='text-muted-foreground'>
            New conversations show up here.
          </p>
        </div>
      )}
      {status === 'success' && messages.length > 0 && (
        <ul className='space-y-3'>
          {messages.map((message) => (
            <li key={message.id} className='truncate'>
              <span className='font-medium'>{message.from}</span>{' '}
              {message.preview}
            </li>
          ))}
        </ul>
      )}
    </section>
  );
}
Give the messages list four states: a skeleton of three gray rows (an avatar circle and two text lines) with a gentle pulse while loading, the loaded list, an empty state that says "No messages yet" with a short hint, and an error state with a "Try again" button that refetches. Keep the card the same height in every state, delay the skeleton by 200ms so fast loads don’t flash, and turn off the pulse when prefers-reduced-motion is set.

Paste into Layerwise or any AI coding tool.

What is Loading state?

Any screen that fetches data passes through a loading state before it shows anything useful. Common choices are a skeleton screen (gray shapes in the layout of the coming content), a spinner, or a progress bar. It is often the first thing people see, so it shapes how fast the app feels.

Plan it together with the three outcomes that can follow: loaded with data, empty (the request worked but there is nothing yet), and error (the request failed). Each needs its own design. An empty inbox should say so and suggest a next step, and an error should explain what happened and offer a Try again button.

Show a skeleton when you know the shape of the content, and a spinner for short actions like saving. Wait 200–300ms before showing any indicator so fast responses don’t flash, and keep the container the same size across states so the page doesn’t jump. Mark the region with aria-busy="true" while it loads so screen readers know to wait.

Often confused with

Skeleton screen
A skeleton screen is one way to show a loading state: gray placeholder shapes in the layout of the content that is coming.

Related terms

All terms

Skeleton screen

A loading placeholder made of gray blocks shaped like the content on its way, often with a soft shimmer, that the real content replaces.

Spinner

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

Empty state

What a screen shows when there is nothing in it yet: a short message, often a simple illustration, and one clear action to add the first item.

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
  • Loading
  • Loaded
  • Empty
  • Error
Messages