Glass Scroll Area
washiveil/glass-scroll-areaFreeComponent
Custom scrollbar as a faint veil, built on Radix ScrollArea.
Install it
npx shadcn@latest add https://washiveil.alexchih.com/r/glass-scroll-area.jsonSource
1'use client'23import * as React from 'react'4import { ScrollArea as ScrollAreaPrimitive } from 'radix-ui'56import { cn } from '@/lib/utils'78const GlassScrollArea = React.forwardRef<9 React.ComponentRef<typeof ScrollAreaPrimitive.Root>,10 React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>11>(({ className, children, ...props }, ref) => (12 <ScrollAreaPrimitive.Root ref={ref} className={cn('relative overflow-hidden', className)} {...props}>13 <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">14 {children}15 </ScrollAreaPrimitive.Viewport>16 <GlassScrollBar />17 <ScrollAreaPrimitive.Corner />18 </ScrollAreaPrimitive.Root>19))20GlassScrollArea.displayName = ScrollAreaPrimitive.Root.displayName2122const GlassScrollBar = React.forwardRef<23 React.ComponentRef<typeof ScrollAreaPrimitive.Scrollbar>,24 React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Scrollbar>25>(({ className, orientation = 'vertical', ...props }, ref) => (26 <ScrollAreaPrimitive.Scrollbar27 ref={ref}28 orientation={orientation}29 className={cn(30 'flex touch-none select-none transition-colors',31 orientation === 'vertical' && 'h-full w-2 border-l border-l-transparent p-[1px]',32 orientation === 'horizontal' && 'h-2 flex-col border-t border-t-transparent p-[1px]',33 className,34 )}35 {...props}36 >37 <ScrollAreaPrimitive.Thumb className="relative flex-1 rounded-full bg-foreground/15 hover:bg-foreground/25" />38 </ScrollAreaPrimitive.Scrollbar>39))40GlassScrollBar.displayName = ScrollAreaPrimitive.Scrollbar.displayName4142export { GlassScrollArea, GlassScrollBar }
What it pulls in
npm packages
Other registry items
Files it writes
More from washiveil
All 58 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Ambient Fieldambient-field | washiveil | Components | Free | no deps | |
| Chipchip | washiveil | Components | Free | 1 dep | |
| Code Badgecode-badge | washiveil | Components | Free | no deps | |
| Glass Accordionglass-accordion | washiveil | Components | Free | 2 deps | |
| Glass Alertglass-alert | washiveil | Components | Free | 1 dep | |
| Glass Alert Dialogglass-alert-dialog | washiveil | Components | Free | 1 dep | |
| Glass Aspect Ratioglass-aspect-ratio | washiveil | Components | Free | 1 dep | |
| Glass Avatarglass-avatar | washiveil | Components | Free | 1 dep |
