Components

Scroll Area

The shadcn/ui Scroll Area with slim custom scrollbars that fade in on hover and out when idle — plus two React scroll blocks: edge fade masks that appear only when there's more content, and a Motion-powered scroll progress bar with a back-to-top button.

  • Drop-in shadcn API
  • Native scrolling
  • Fading scrollbars
  • Edge fade masks
  • Motion block
  • Ada Kim commented on Dock spring tuning
  • Deploy #482 finished in 41s
  • Sam Patel requested your review
  • New sign-in from Berlin
  • Lee Wong merged motion-presets
  • Weekly usage report is ready
  • Maya Ruiz mentioned you in Design QA
  • Invoice for November is available
  • Deploy #481 rolled back
  • 3 new issues labelled a11y
  • Your API key expires in 7 days
  • Ada Kim starred dusk-web
ReactMotionRadixTailwindshadcn/uia11ySpringsLayoutGesturesSSR

Installation

$ npx shadcn@latest add https://duskui.com/r/scroll-area.json

Same exports and props as the shadcn/ui Scroll Area (ScrollArea and ScrollBar), plus optional viewportRef and viewportClassName to reach the scrolling element. CSS only, no Motion.

Usage

release-list.tsx
import { ScrollArea } from "@/components/ui/scroll-area"

export function ReleaseList({ releases }: { releases: string[] }) {
  return (
    <ScrollArea className="h-72 w-48 rounded-md border">
      <div className="p-4">
        {releases.map((release) => (
          <div key={release} className="py-2 text-sm">{release}</div>
        ))}
      </div>
    </ScrollArea>
  )
}

Examples

Default

Hover the list: the scrollbar fades in, brightens when you hover it and while you drag the thumb, and fades out shortly after the pointer leaves. Wheel, touch and keyboard scrolling stay native. Pass type="scroll" to show it only while scrolling, or type="always".

Releases

v2.40.0
v2.39.0
v2.38.0
v2.37.0
v2.36.0
v2.35.0
v2.34.0
v2.33.0
v2.32.0
v2.31.0
v2.30.0
v2.29.0
v2.28.0
v2.27.0
v2.26.0
v2.25.0
v2.24.0
v2.23.0
v2.22.0
v2.21.0
v2.20.0
v2.19.0
v2.18.0
v2.17.0
v2.16.0
v2.15.0
v2.14.0
v2.13.0
v2.12.0
v2.11.0
v2.10.0
v2.9.0
v2.8.0
v2.7.0
v2.6.0
v2.5.0
v2.4.0
v2.3.0
v2.2.0
v2.1.0

Horizontal

Add <ScrollBar orientation="horizontal" /> and give the content w-max to scroll sideways.

Northern Ridge
Glass Harbor
Moss Line
Low Tide
Ember Field
Night Garden

Blocks

Ready-made variations composed from the base component with Motion. Each installs on its own and pulls in its dependencies automatically.

Fade Scroll Area

Edges fade out only when there's more to see in that direction: scroll down and the top begins to fade, reach the end and the bottom fade disappears; if everything fits there's no fade at all. The fades are a CSS mask, so they work over any background, and they grow with the scroll distance instead of popping. Works vertically or horizontally, updates in a requestAnimationFrame and never re-renders React.

  • Ada Kim commented on Dock spring tuning
  • Deploy #482 finished in 41s
  • Sam Patel requested your review
  • New sign-in from Berlin
  • Lee Wong merged motion-presets
  • Weekly usage report is ready
  • Maya Ruiz mentioned you in Design QA
  • Invoice for November is available
  • Deploy #481 rolled back
  • 3 new issues labelled a11y
  • Your API key expires in 7 days
  • Ada Kim starred dusk-web
ReactMotionRadixTailwindshadcn/uia11ySpringsLayoutGesturesSSR
$ npx shadcn@latest add https://duskui.com/r/fade-scroll-area.json
PropTypeDefaultDescription
orientation"vertical" | "horizontal""vertical"Scroll direction. Horizontal adds a horizontal scrollbar and side fades.
fadeSizenumber40Length of each edge fade in px.
…ScrollArea propsScrollArea props—className, type, scrollHideDelay, viewportRef, viewportClassName…

Scroll Progress

A reading-progress bar along the top fills as you scroll, spring-smoothed with Motion's useScroll + useSpring on the viewport. Past backToTop, a button rises in whose ring traces the same progress and scrolls back to the top. Scrolling never re-renders React.

Five rules for interface motion

1. Springs, not curves

Springs carry velocity from one gesture into the next, so interrupted motion never jumps. Give them a duration and a bounce instead of stiffness and damping when you want predictable timing.

2. Animate the cheap things

Transforms and opacity run on the compositor. Width, height and top cause layout on every frame — reach for layout animations or FLIP instead.

3. Exit faster than you enter

Entrances can take their time to explain where something came from. Exits should get out of the way: roughly half the duration feels right.

4. Respect reduced motion

Swap slides and scales for fades when the user asks for less motion. The interface should keep its meaning, not its choreography.

5. Direction is information

Content that slides in from the side you're moving toward tells people where they are without a single word of copy.

$ npx shadcn@latest add https://duskui.com/r/scroll-progress.json
PropTypeDefaultDescription
backToTopnumber | false0.2Show the back-to-top button after this fraction of the content. false hides it.
barClassNamestring—Classes for the progress bar, e.g. a different color.
…ScrollArea propsScrollArea props—className sizes the wrapper; the rest go to the ScrollArea.

API Reference

ScrollArea wraps Radix's Root, Viewport, a vertical ScrollBar and Corner. Add more ScrollBars as children.

PropTypeDefaultDescription
type"auto" | "always" | "scroll" | "hover""hover"When scrollbars are shown (on ScrollArea).
scrollHideDelaynumber600ms before scrollbars fade out (on ScrollArea).
viewportRefRef<HTMLDivElement>—Ref to the scrolling element (on ScrollArea).
viewportClassNamestring—Classes for the scrolling element (on ScrollArea).
orientation"vertical" | "horizontal""vertical"On ScrollBar.

Accessibility

  • Scrolling stays native: wheel, trackpad, touch, keyboard (arrows, Page Up/Down, Space) and screen-reader navigation all work as usual.
  • The viewport shows a focus ring when it's focused for keyboard scrolling.
  • Custom scrollbars are decorative mirrors of the native scroll position; the thumb has a 44px hit area for pointer users.
  • Scroll Progress's back-to-top button is a labelled button, and the progress bar is hidden from assistive tech.
  • Under prefers-reduced-motion scrollbars appear without fading, the progress bar tracks exactly and back-to-top jumps instantly.