Browse docsScroll Area

SurfacesNew

Glass Scroll Area

A scroll container with a thin glass scrollbar that shows on hover and while scrolling.

Preview

  • Version 2.6Search finds files by their contents.
  • Version 2.5Shared folders sync in the background.
  • Version 2.4Pin a project to keep it at the top.
  • Version 2.3Undo now reaches back a whole day.
  • Version 2.2Export a board as a single image.
  • Version 2.1Comments show who has read them.

Demos ready. Update 0.

Installation

For React 19+ apps with Tailwind CSS 4.

npx shadcn@4.14.1 add https://glassyui.com/r/glass-scroll-area.json

Adds 5 files to components/glassyui and installs @radix-ui/react-scroll-area and clsx.

Usage

Usage

import { GlassScrollArea } from "@/components/glassyui/glass-scroll-area";

export function ReleaseNotes({ notes }: { notes: string[] }) {
  return (
    <GlassScrollArea
      className="h-64"
      viewportProps={{ "aria-label": "Release notes", role: "region", tabIndex: 0 }}
    >
      <ul className="space-y-3 p-4">
        {notes.map((note) => (
          <li key={note}>{note}</li>
        ))}
      </ul>
    </GlassScrollArea>
  );
}

Examples

Grow to a maximum height

<GlassScrollArea className="max-h-80">{children}</GlassScrollArea>
Scroll sideways

<GlassScrollArea scrollbars="horizontal">
  <div className="flex w-max gap-3">{cards}</div>
</GlassScrollArea>
Show the scrollbar whenever the content overflows

<GlassScrollArea type="auto" className="h-64">{children}</GlassScrollArea>

API reference

GlassScrollArea

A div whose viewport scrolls natively, with glass scrollbars in place of the system's.

PropTypeDefaultDescription
scrollbars'vertical' | 'horizontal' | 'both''vertical'Which scrollbars to draw.
type'hover' | 'scroll' | 'auto' | 'always''hover'When a scrollbar shows: on hover and while scrolling, only while scrolling, whenever the content overflows, or always.
scrollHideDelaynumber600Milliseconds a scrollbar stays after the pointer leaves or scrolling stops.
viewportPropsScrollAreaViewportPropsNoneProps for the element that scrolls, such as a ref, role or aria-label.

Also accepts HTML div attributes.

Types
GlassScrollAreaProps
Accessibility
When the content holds no links or controls, pass tabIndex={0}, role="region" and an aria-label in viewportProps so keyboard users can scroll it.