Skip to content
MoonUIMoonUI
ComponentsTemplatesPricing
Sign inGet started

Getting started

  • Introduction
  • Installation
  • CDN
  • Authentication
  • shadcn CLI
  • MCP Server
  • Usage

Components

Foundation25 components
  • Alert
  • Aspect Ratio
  • Avatar
  • Badge
  • Button
  • Button Group
  • Checkbox
  • File Upload
  • Input
  • Kbd
  • Label
  • Radio Group
  • Rating
  • Select
  • Slider
  • Switch
  • Textarea
  • Toggle
  • Toggle Group
  • Separator
  • Tags Input
  • Color Picker
  • Date Picker
  • Simple Editor
  • Input OTP
Layout10 components
  • Accordion
  • Breadcrumb
  • Card
  • Carousel
  • Collapsible
  • ResizablePro
  • Scroll Area
  • StepperPro
  • Table
  • Tabs
Navigation & Overlays11 components
  • Alert DialogPro
  • Command
  • Context MenuPro
  • Dialog
  • Dropdown Menu
  • Hover CardPro
  • MenubarPro
  • Pagination
  • Popover
  • SheetPro
  • Tooltip
Feedback4 components
  • Progress
  • Skeleton
  • Spinner
  • Toast
Data & Analytics4 components
  • Data TablePro
  • Advanced ChartPro
  • DashboardPro
  • WidgetsPro
Navigation4 components
  • Command AI+Pro
  • SidebarPro
  • NavbarPro
  • Navigation MenuPro
AI Chat4 components
  • MessagePro
  • Message ScrollerPro
  • AttachmentPro
  • Conversation MarkerPro
Content Management6 components
  • Advanced FormsPro
  • Form WizardPro
  • Quiz FormPro
  • Credit Card InputPro
  • Phone Number InputPro
  • Rich Text EditorPro
Project Management3 components
  • KanbanPro
  • TimelinePro
  • CalendarPro
Performance & Utility8 components
  • Virtual ListPro
  • Memory Efficient DataPro
  • Lazy ComponentPro
  • Optimized ImagePro
  • Performance MonitorPro
  • Performance DebuggerPro
  • Error BoundaryPro
  • Health CheckPro
Interactive & Animation15 components
  • Animated NumberPro
  • Floating DockPro
  • Text RevealPro
  • Image ComparePro
  • Splash CursorPro
  • GitHub StarsPro
  • Animated ButtonPro
  • Magnetic ButtonPro
  • Magnetic ElementsPro
  • Mouse TrailPro
  • Hover Card 3DPro
  • Spotlight CardPro
  • Floating Action ButtonPro
  • LightboxPro
  • Media GalleryPro
Gesture & Touch7 components
  • Swipeable CardPro
  • Draggable ListPro
  • Pinch ZoomPro
  • Swipe ActionsPro
  • Gesture DrawerPro
  • Click AnimationsPro
  • Touch GesturesPro
Text Animations12 components
  • Text HighlighterPro
  • Typewriter TextPro
  • Scrambled TextPro
  • Word RotatePro
  • Morphing TextPro
  • Flip TextPro
  • Number TickerPro
  • Glitch TextPro
  • Shiny TextPro
  • Wavy TextPro
  • Gradient TextPro
  • Text 3DPro
Animations12 components
  • Animated ListPro
  • Bounce EffectPro
  • Blur FadePro
  • Elastic AnimationPro
  • MarqueePro
  • Parallax ScrollPro
  • Reveal CardsPro
  • Scroll RevealPro
  • Fade TransitionsPro
  • Focus TransitionsPro
  • Path AnimationsPro
  • SVG AnimationsPro
Layouts1 components
  • Bento GridPro
Effects9 components
  • ConfettiPro
  • Cursor TrailPro
  • Glow EffectPro
  • Pixel ImagePro
  • Neon EffectPro
  • ShimmerPro
  • RipplePro
  • SparklesPro
  • SpotlightPro
Backgrounds17 components
  • Grid PatternPro
  • MeteorsPro
  • Aurora BackgroundPro
  • ParticlesPro
  • StarfieldPro
  • Dot PatternPro
  • Grid DistortionPro
  • WavesPro
  • Matrix RainPro
  • Liquid BackgroundPro
  • Mesh GradientPro
  • Glitch BackgroundPro
  • Gradient FlowPro
  • Floating ElementsPro
  • Bubble BackgroundPro
  • Geometric PatternsPro
  • Code SnippetsPro
Special UI1 components
  • Glow CardPro
Showcase8 components
  • iPhone MockPro
  • Android MockPro
  • Safari MockPro
  • GlobePro
  • Dotted MapPro
  • Icon CloudPro
  • Tweet CardPro
  • File TreePro

Advanced

  • Theming
  • Customization
  • CLI
  • Help & Support
  1. Docs
  2. Components
  3. Message Scroller

Message Scroller

Pro

A stick-to-bottom scroll container for AI chat threads. As streamed tokens and new messages arrive it keeps the newest content pinned to the bottom, and it releases the moment the reader scrolls up — with an optional scroll-to-bottom button, top/bottom anchoring, and an accessible live log region.

Pro features

What the Pro version adds to this component.

  • Stick-to-Bottom Streaming

    Newly appended tokens and messages keep the newest content pinned to the bottom edge, so streamed AI responses stay in view automatically

  • Auto-Release on Scroll

    The moment the reader scrolls up, following pauses and onFollowChange fires — no more fighting the scrollbar to read earlier context

  • Scroll-to-Bottom Button

    An optional floating button appears while following is paused and jumps back to the newest message with a single click

  • Bottom or Top Anchor

    Anchor to the bottom for classic chat, or to the top for feeds that grow downward and load older history above

  • Observer-Driven Growth

    Content growth is detected with a ResizeObserver plus a MutationObserver — no requestAnimationFrame loop and fully SSR-safe

  • Accessible Log Region

    role=log with aria-live announces new messages to screen readers, while token-based surfaces handle dark mode automatically

Installation

Install via CLI

npx @moontra/moonui-cli add message-scroller

Usage

Pro required
NV
Nova
Welcome back! I pulled the latest deploy logs for you.
09:30
MK
Maya
Thanks — did the migration step succeed this time?
09:31
NV
Nova
Yes, all 14 migrations ran cleanly and the health check is green.
09:31
MK
Maya
Great. Can you show me the slowest three endpoints from the last hour?
09:32
NV
Nova
Sure — /reports/export at 820ms, /search at 540ms, and /billing at 410ms.
09:32
MK
Maya
Let's add caching to the export route first.
09:33
NV
Nova
Good call. I drafted a 60-second edge cache with stale-while-revalidate.
09:33
MK
Maya
Ship it to staging and keep this thread updated as it streams.
09:34

Examples

Chat Container

Pro

Give the scroller a fixed height (h-[400px]) and it becomes a scrollable chat window around a column of real Message rows. With showScrollButton, scrolling up reveals a floating button that jumps back to the newest message and re-enables following.

Pro required

Streaming Response

Pro

The core AI-chat behavior: press Stream response to append an assistant message that grows token by token. While you are at the bottom the scroller stays pinned to the newest text; scroll up mid-stream and it releases (the indicator flips to Paused) so you can read earlier context without being yanked down. onFollowChange drives that indicator.

Pro required

Bordered Variant and Top Anchor

Pro

The bordered variant frames the thread with a rounded border and background surface. Set anchor="top" for feeds that grow downward or load older history above — new content sticks to the top edge instead of the bottom, and the scroll-to-bottom button (bottom-only) is hidden.

Pro required
Previous
Message
Pro
Next
Attachment
Pro
MoonUIMoonUI

168 React components. 45 free under MIT, 123 Pro.

Unsubscribe anytime.

Product

  • Components
  • Templates
  • Pricing

Resources

  • Documentation
  • GitHub
  • Support

Legal

  • Privacy
  • Terms
  • Refund Policy
Made by Moontra Software
  • X
  • LinkedIn
  • GitHub
  • YouTube