GooseUI

Components

Scroll Container


A scroll area with a scrollbar in your theme colors. It is a server component with no JavaScript: one shared stylesheet, the variant and modes live in data attributes.

Browser Support

scrollbar-color

Colors the scrollbar

Your browser:
scrollbar-width

Controls scrollbar width

Your browser:
scrollbar-gutter

Reserves space for the scrollbar

Your browser:
color-mix()

Colors the scrollbar thumb and track

Your browser:

Preview

Three variants. The switch turns auto-hide on for all of them. On macOS overlay scrollbars the track is not drawn.

Default

  • Anna10:02

    Did you see the new build?

  • Max10:04

    Yes, the review is almost done

  • Anna10:05

    Great, I will merge after lunch

  • Ivan10:11

    Can someone check the staging deploy?

  • Max10:12

    On it, give me five minutes

  • Max10:19

    Staging is green, no errors in the logs

  • Olga10:26

    Updated the pricing page copy

  • Anna10:27

    Looks good, thanks!

  • Ivan10:41

    Release notes are in the doc

  • Olga10:43

    Added a screenshot to the changelog

  • Max10:50

    Let's ship it tomorrow morning

  • Anna10:52

    Agreed, I will post the announcement

Minimal

  • Design

    12 files

    Today
  • roadmap-2026.pdf

    2.4 MB

    Mon
  • hero-banner.png

    860 KB

    Mon
  • Invoices

    38 files

    Sun
  • brand-guidelines.pdf

    5.1 MB

    Sat
  • team-photo.jpg

    3.2 MB

    Fri
  • meeting-notes.md

    14 KB

    Fri
  • Archive

    104 files

    Thu
  • logo-dark.svg

    6 KB

    Wed
  • contract-draft.docx

    212 KB

    Wed
  • Screenshots

    57 files

    Tue
  • budget-q4.xlsx

    420 KB

    Tue

Primary

  • Anna Petrova2 min

    commented on your pull request

  • GitHub14 min

    Build #482 passed

  • Max Orlov32 min

    mentioned you in #design

  • Billing1 h

    Invoice for November is ready

  • Olga Smirnova2 h

    invited you to the Launch project

  • Vercel3 h

    Deployment is live on production

  • Ivan Kuznetsov5 h

    liked your comment

  • SecurityYesterday

    New sign-in from Chrome on macOS

  • Anna PetrovaYesterday

    shared the file roadmap-2026.pdf

  • CalendarYesterday

    Planning starts in 15 minutes

  • SupportMon

    Your request #1204 is resolved

  • Max OrlovMon

    assigned you a task

Installation

npx shadcn@latest add @gooseui/scroll-container
pnpm dlx shadcn@latest add @gooseui/scroll-container
yarn dlx shadcn@latest add @gooseui/scroll-container
bunx --bun shadcn@latest add @gooseui/scroll-container

Usage

import { ScrollContainer } from "@/components/ui/scroll-container"

<ScrollContainer height="20rem">
  <div className="p-4 space-y-4">
    {/* Your scrollable content */}
  </div>
</ScrollContainer>

Examples

Auto-hide scrollbar

<ScrollContainer height="16rem" autoHide>
  {/* Scrollbar appears on hover and focus, hidden otherwise */}
</ScrollContainer>

Variants

<ScrollContainer variant="default" />
<ScrollContainer variant="minimal" />
<ScrollContainer variant="primary" />

Props

PropTypeDefaultDescription
heightstring | number"100%"Container height, number in px or any CSS length
autoHidebooleanfalseShow the scrollbar only on hover or focus, with a fade. Touch screens always show it
variant"default" | "minimal" | "primary""default"default: thumb muted-foreground/50 on a muted track. minimal: thin translucent thumb without a track (4px in the Safari fallback). primary: thumb in the primary color
forceVisiblebooleanfalseReserve space for the scrollbar with scrollbar-gutter: stable. Does not make overlay scrollbars permanent
refRef<HTMLDivElement>-Ref to the scrolling div
classNamestring-Additional CSS classes