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

Overflow

Also called overflow: hidden or overflow: auto

A CSS property that decides what happens when content is bigger than its box: spill out, get clipped, or scroll inside it.

import { useEffect, useRef } from 'react';

type Message = { id: string; author: string; text: string };

export function ChatPanel({ messages }: { messages: Message[] }) {
  const listRef = useRef<HTMLOListElement>(null);

  // Start at the newest message.
  useEffect(() => {
    const list = listRef.current;
    if (list) list.scrollTop = list.scrollHeight;
  }, [messages.length]);

  return (
    // overflow-hidden clips the children to the rounded corners.
    <section className='flex w-96 flex-col overflow-hidden rounded-2xl border'>
      {/* A fixed height that scrolls inside, with a scrollbar only when needed;
          overscroll-contain stops the page from scrolling at the ends. */}
      <ol
        ref={listRef}
        className='h-[480px] space-y-3 overflow-y-auto overscroll-contain p-4'
      >
        {messages.map((message) => (
          <li key={message.id} className='text-sm'>
            <span className='font-medium'>{message.author}</span>{' '}
            <span className='text-muted-foreground'>{message.text}</span>
          </li>
        ))}
      </ol>
      <form className='border-t p-3'>
        <input
          aria-label='Message'
          placeholder='Write a message'
          className='w-full rounded-lg border bg-background px-3 py-2 text-sm'
        />
      </form>
    </section>
  );
}
Give the chat history a fixed height of 480px with overflow-y: auto so it scrolls inside the panel, keep the message input pinned below it, and scroll to the newest message on load. Let wide tables scroll sideways with overflow-x: auto on phones, and clip card images to the card’s 16px corner radius with overflow: hidden.

Paste into Layerwise or any AI coding tool.

What is Overflow?

When content does not fit its box, overflow decides what to do. visible, the default, lets it spill out over whatever comes next. hidden clips it at the edge. scroll makes the box scrollable and always reserves room for scrollbars, while auto shows scrollbars only when the content actually overflows. overflow-x and overflow-y set each direction on its own.

Use auto for panels with a fixed height, such as a chat history or a long sidebar list, and overflow-x: auto for wide tables on phones. Use hidden to crop images to a card’s rounded corners or to keep a decorative shape from making the page scroll sideways.

Watch for side effects. hidden on a parent also cuts off dropdowns and tooltips inside it, and hidden, scroll, and auto all make the parent the box that position: sticky children stick inside. If a phone page scrolls sideways, find the element that is too wide before hiding overflow on body; overflow: clip crops without creating a scroll container.

Related terms

All terms

Sticky header

A top bar that stays pinned to the top of the screen while the page scrolls underneath it, so navigation is always one click away.

Z-index

A CSS property that decides which element appears on top when elements overlap, with higher numbers sitting closer to the viewer.

Scroll snap

A CSS feature that makes a scroll container settle on set points, so carousels and full-screen sections come to rest neatly on an item.

Horizontal scroll section

A pinned section where scrolling down moves a row of cards sideways, turning vertical scrolling into horizontal movement.

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
overflow: visible;
  • Dark mode
  • Faster search
  • New billing page
  • Team invites
  • CSV export
  • Keyboard shortcuts
  • Bug fixes
Next section