Scroll Area

A native scroll container with custom scrollbars.

API Reference

Installation

npx love-ui@latest add scroll-area

Usage

import { ScrollArea } from "@/components/ui/scroll-area"
<ScrollArea className="h-64 rounded-md border">
  <div className="p-4">
    Just as suddenly as it had begun, the sensation stopped, leaving Alice
    feeling slightly disoriented. She looked around and realized that the room
    hadn't changed at all - it was she who had grown smaller, shrinking down to
    a fraction of her previous size. Alice felt herself growing larger and
    larger, filling up the entire room until she feared she might burst. The
    sensation was both thrilling and terrifying, as if she were expanding beyond
    the confines of her own body. She wondered if this was what it felt like to
    be a balloon, swelling with air until it could hold no more.
  </div>
</ScrollArea>

Examples

Horizontal Scroll

Both Scrollbars

Comparing with Radix / shadcn

If you’re already familiar with Radix UI and shadcn/ui, this guide highlights the small differences and similarities so you can get started with loveui quickly.

Quick Checklist

  • If you used asChild on parts, switch to the render prop

Additional Notes

Compared to shadcn/ui, our ScrollArea adds orientation="both", which renders both vertical and horizontal scrollbars (and the corner). Use it when content can overflow on both axes.