Marquee
shadcn-ui-blocks/marqueeFreeComponent
A simple marquee
Install it
npx shadcn@latest add https://shadcnui-blocks.com/r/marquee.jsonSource
1import type { ComponentPropsWithoutRef } from "react";2import { cn } from "@/lib/utils";34interface MarqueeProps extends ComponentPropsWithoutRef<"div"> {5 /**6 * Optional CSS class name to apply custom styles7 */8 className?: string;9 /**10 * Whether to reverse the animation direction11 * @default false12 */13 reverse?: boolean;14 /**15 * Whether to pause the animation on hover16 * @default false17 */18 pauseOnHover?: boolean;19 /**20 * Content to be displayed in the marquee21 */22 children: React.ReactNode;23 /**24 * Whether to animate vertically instead of horizontally25 * @default false26 */27 vertical?: boolean;28 /**29 * Number of times to repeat the content30 * @default 431 */32 repeat?: number;33}3435export function Marquee({36 className,37 reverse = false,38 pauseOnHover = false,39 children,40 vertical = false,41 repeat = 4,42 ...props43}: MarqueeProps) {44 return (45 <div46 {...props}47 className={cn(48 "group flex overflow-hidden p-2 [--duration:40s] [--gap:1rem] [gap:var(--gap)]",49 {50 "flex-row": !vertical,51 "flex-col": vertical,52 },53 className54 )}55 >56 {Array(repeat)57 .fill(0)58 .map((_, i) => (59 <div60 className={cn("flex shrink-0 justify-around [gap:var(--gap)]", {61 "animate-marquee flex-row": !vertical,62 "animate-marquee-vertical flex-col": vertical,63 "group-hover:[animation-play-state:paused]": pauseOnHover,64 "[animation-direction:reverse]": reverse,65 })}66 key={i}67 >68 {children}69 </div>70 ))}71 </div>72 );73}
Files it writes
More from Shadcn UI Blocks
All 542 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Default Accordionaccordion-01 | Shadcn UI Blocks | Components | Free | no deps | |
| Outline Accordionaccordion-02 | Shadcn UI Blocks | Components | Free | no deps | |
| Box Accordionaccordion-03 | Shadcn UI Blocks | Components | Free | no deps | |
| Contained Accordionaccordion-04 | Shadcn UI Blocks | Components | Free | no deps | |
| Box Contained Accordionaccordion-05 | Shadcn UI Blocks | Components | Free | no deps | |
| Tabs Accordionaccordion-06 | Shadcn UI Blocks | Components | Free | no deps | |
| Highlight Active Item Accordionaccordion-07 | Shadcn UI Blocks | Components | Free | no deps | |
| Multiple Expanded at a time Accordionaccordion-08 | Shadcn UI Blocks | Components | Free | no deps |
