#17 · Primary category: AI UI Components & Blocks Library
use-stick-to-bottom
A lightweight React Hook intended mainly for AI chat applications, for smoothly sticking to bottom of messages
Project last updated:06/04/26
GitHub Stars
772
Forks
58
Contributors
12
License
MIT
Why we included this project
Chat apps that stream tokens from an LLM have a deceptively annoying problem: the message list needs to stay pinned to the bottom as new content arrives, and the viewport shouldn't jump around while it happens. This hook handles that without relying on overflow-anchor, which Safari still doesn't support, and it uses ResizeObserver plus a velocity-based spring animation instead of fixed-duration easing, so it copes when streamed messages change size mid-flight. Scrolling up cancels the stickiness whenever the user wants, and the library can tell a real scroll apart from its own animation events, which keeps the behavior sane on mobile. You can attach it to an existing component through refs, or use the bundled component that exposes context for checking isAtBottom and triggering scrolls. It has zero dependencies, so it won't bloat a React app.
Articles for this project
No articles for this project yet.
To suggest a topic or contribute an article, contact us.
Related projects in this category
react-bits
An open source collection of animated, interactive & fully customizable React components for building memorable websites.
opentui
OpenTUI is a library to build terminal user interfaces (TUI)
coreui-free-bootstrap-admin-template
Free Bootstrap Admin & Dashboard Template Built for AI-Assisted Development
icons
beautifully crafted animated icons
next-shadcn-dashboard-starter
Free, open source, AI-friendly admin dashboard template built with Next.js 16, shadcn/ui, Tailwind CSS, and TypeScript. Production-ready tables, forms, auth, and billing. MIT licensed.