Marquee
boldkit/marqueeFreeComponent
Auto-scrolling text ticker with neubrutalism styling - a common brutalist design element
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/marquee.jsonSource
1import * as React from 'react'2import { cn } from '@/lib/utils'34interface MarqueeProps extends React.HTMLAttributes<HTMLDivElement> {5 /** Content to display in the marquee */6 children: React.ReactNode7 /** Direction of the marquee animation */8 direction?: 'left' | 'right'9 /** Speed of the animation: 'slow' | 'normal' | 'fast' */10 speed?: 'slow' | 'normal' | 'fast'11 /** Pause animation on hover */12 pauseOnHover?: boolean13 /** Show neubrutalism border styling */14 bordered?: boolean15 /** Number of times to repeat the content (for seamless loop) */16 repeat?: number17}1819const speedClasses = {20 slow: 'animate-marquee-slow',21 normal: 'animate-marquee',22 fast: 'animate-marquee-fast',23}2425const Marquee = React.forwardRef<HTMLDivElement, MarqueeProps>(26 (27 {28 className,29 children,30 direction = 'left',31 speed = 'normal',32 pauseOnHover = true,33 bordered = true,34 repeat = 4,35 ...props36 },37 ref38 ) => {39 // Use the speed-based class for both directions so `speed` is always40 // honored; flip to a right-scroll via animation-direction (the dedicated41 // *-reverse speed classes were never defined in the CSS).42 const animationClass = speedClasses[speed]43 const animationDirection = direction === 'right' ? 'reverse' : undefined4445 return (46 <div47 ref={ref}48 className={cn(49 'flex overflow-hidden',50 bordered && 'border-3 border-foreground bg-background',51 className52 )}53 {...props}54 >55 <div56 className={cn(57 'marquee-content flex shrink-0 items-center gap-8 py-3',58 animationClass,59 pauseOnHover && 'hover:[animation-play-state:paused]'60 )}61 style={{ animationDirection }}62 >63 {Array.from({ length: repeat }).map((_, i) => (64 <React.Fragment key={i}>{children}</React.Fragment>65 ))}66 </div>67 <div68 className={cn(69 'marquee-content flex shrink-0 items-center gap-8 py-3',70 animationClass,71 pauseOnHover && 'hover:[animation-play-state:paused]'72 )}73 style={{ animationDirection }}74 aria-hidden="true"75 >76 {Array.from({ length: repeat }).map((_, i) => (77 <React.Fragment key={i}>{children}</React.Fragment>78 ))}79 </div>80 </div>81 )82 }83)84Marquee.displayName = 'Marquee'8586// … truncated
What it pulls in
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | boldkit | Components | Free | 2 deps | |
| Alertalert | boldkit | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Badgebadge | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps |
