Componentnavigation0.58 KB gzipZero dependencies
ScrollShadow
Wrapper with top/bottom shadow indicators that fade in only when scrollable in that direction; dashed scrollbar styling.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add scroll-shadowOr install the full npm package:
npm install bigbulluiUsage
tsx5 lines
import { ScrollShadow } from "@/components/ui/scroll-shadow" <ScrollShadow> <div className="p-4 bg-card h-full">Content with scroll</div></ScrollShadow>Source code
scroll-shadow.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxscroll-shadow.tsx73 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export type ScrollShadowProps = { className?: string; children?: React.ReactNode;} & React.HTMLAttributes<HTMLElement>; export function ScrollShadow({ className, children, ...props }: ScrollShadowProps) { const ref = React.useRef<HTMLDivElement>(null); React.useEffect(() => { const element = ref.current; if (!element) return; const handleScroll = () => {Props
| Prop | Type | Description |
|---|---|---|
| className | string | Optional additional className string. |
| children | React.ReactNode | Child elements rendered inside the component. |