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
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add scroll-shadow

Or install the full npm package:

npm install bigbullui

Usage

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 helper

Zero 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

PropTypeDescription
classNamestringOptional additional className string.
childrenReact.ReactNodeChild elements rendered inside the component.