Scroll Shadow
UtilitiesA scroll container component that displays gradient shadows to indicate scrollable content. Helps users understand there is more content above or below.
Import
import { ScrollShadow } from "@/components/ui/scroll-shadow";Usage
Vertical Scroll
Shadow indicators for vertical scrolling
Scroll to see the shadow indicators appear
Horizontal Scroll
Shadow indicators for horizontal scrolling
Shadow Sizes
Different shadow gradient sizes. Shadows automatically reduce on mobile for better proportions.
Small
Medium
Large
Hidden Scrollbar
Scrollable content without visible scrollbar
The scrollbar is hidden but scrolling still works
Responsive Behavior
Shadow sizes automatically reduce on mobile screens for better proportions
The ScrollShadow component detects screen size and adjusts shadow intensity:
- Mobile (<640px): Smaller shadows (sm: 12px, md: 24px, lg: 36px)
- Desktop (≥640px): Standard shadows (sm: 20px, md: 40px, lg: 60px)
Resize your browser to see the shadow size change
API Reference
orientation"vertical""horizontal" | "vertical" | "both"Direction of the scroll shadows
size"md""sm" | "md" | "lg"Size of the gradient shadow
hideScrollbarfalsebooleanHide the native scrollbar
children*—ReactNodeScrollable content
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "both" | "vertical" | Direction of the scroll shadows |
size | "sm" | "md" | "lg" | "md" | Size of the gradient shadow |
hideScrollbar | boolean | false | Hide the native scrollbar |
children* | ReactNode | — | Scrollable content |