{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"marquee","type":"registry:ui","title":"Marquee","description":"Seamless infinite marquee for logos or testimonials with faded edges, direction, speed and vertical mode.","dependencies":[],"registryDependencies":["utils"],"files":[{"path":"registry/items/marquee/marquee.tsx","type":"registry:ui","target":"components/facade/marquee.tsx","content":"import * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface MarqueeProps extends React.HTMLAttributes<HTMLDivElement> {\n  children?: React.ReactNode;\n  /** Seconds for one full loop. Lower is faster. Defaults to 30. */\n  speed?: number;\n  /** Scroll direction. In vertical mode \"left\" scrolls up and \"right\" scrolls down. Defaults to \"left\". */\n  direction?: \"left\" | \"right\";\n  /** Pause the animation while hovered. Defaults to true. */\n  pauseOnHover?: boolean;\n  /** Fade the edges with a mask-image. Defaults to true. */\n  fade?: boolean;\n  /** Scroll vertically instead of horizontally. */\n  vertical?: boolean;\n  /** Gap between items as a CSS length. Defaults to \"3rem\". */\n  gap?: string;\n  /**\n   * How many times children are repeated inside each copy of the track.\n   * Raise it when your content is narrower than the container. Defaults to 1.\n   */\n  repeat?: number;\n  /** Class applied to each copy of the content. */\n  trackClassName?: string;\n}\n\nconst VERTICAL_KEYFRAMES =\n  \"@keyframes facade-marquee-y{from{transform:translateY(0)}to{transform:translateY(calc(-50% - var(--marquee-gap, 1rem) / 2))}}\";\n\n/**\n * Infinite marquee. Children are rendered in two identical copies inside one\n * track, which `animate-marquee` (globals.css) shifts by exactly one copy.\n */\nexport function Marquee({\n  children,\n  speed = 30,\n  direction = \"left\",\n  pauseOnHover = true,\n  fade = true,\n  vertical = false,\n  gap = \"3rem\",\n  repeat = 1,\n  className,\n  trackClassName,\n  style,\n  ...rest\n}: MarqueeProps) {\n  const mask = vertical\n    ? \"linear-gradient(to bottom, transparent, black 14%, black 86%, transparent)\"\n    : \"linear-gradient(to right, transparent, black 12%, black 88%, transparent)\";\n\n  const rootStyle = {\n    \"--marquee-duration\": `${speed}s`,\n    \"--marquee-gap\": gap,\n    ...(fade ? { maskImage: mask, WebkitMaskImage: mask } : {}),\n    ...style,\n  } as React.CSSProperties;\n\n  const trackStyle: React.CSSProperties = {\n    gap: \"var(--marquee-gap)\",\n    animationDirection: direction === \"right\" ? \"reverse\" : \"normal\",\n    ...(vertical ? { animation: \"facade-marquee-y var(--marquee-duration, 30s) linear infinite\" } : {}),\n  };\n\n  const copy = (hidden: boolean) => (\n    <div\n      aria-hidden={hidden || undefined}\n      className={cn(\"flex shrink-0 items-center\", vertical ? \"flex-col\" : \"flex-row\", trackClassName)}\n      style={{ gap: \"var(--marquee-gap)\" }}\n    >\n      {Array.from({ length: Math.max(1, repeat) }, (_, i) => (\n        <React.Fragment key={i}>{children}</React.Fragment>\n      ))}\n    </div>\n  );\n\n  return (\n    <div\n      {...rest}\n      style={rootStyle}\n      className={cn(\"group/marquee relative flex overflow-hidden\", vertical ? \"flex-col\" : \"flex-row\", className)}\n    >\n      {vertical ? <style>{VERTICAL_KEYFRAMES}</style> : null}\n      <div\n        style={trackStyle}\n        className={cn(\n          \"flex shrink-0\",\n          vertical ? \"h-max flex-col\" : \"w-max flex-row animate-marquee\",\n          \"motion-reduce:[animation-play-state:paused]\",\n          pauseOnHover && \"group-hover/marquee:[animation-play-state:paused] group-focus-within/marquee:[animation-play-state:paused]\",\n        )}\n      >\n        {copy(false)}\n        {copy(true)}\n      </div>\n    </div>\n  );\n}\n\nexport default Marquee;\n"}],"categories":["layout"],"meta":{"tier":"free","demo":"import { Coffee, Dumbbell, Home, Key, Scissors, Sun, Trees, Utensils, Wrench } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Marquee } from \"./marquee\";\n\ninterface Brand {\n  name: string;\n  icon: LucideIcon;\n  style: string;\n}\n\nconst row1: Brand[] = [\n  { name: \"Juniper & Co.\", icon: Trees, style: \"font-display font-semibold tracking-[-0.02em]\" },\n  { name: \"HEARTH HOMES\", icon: Home, style: \"font-semibold tracking-[0.18em] text-[13px]\" },\n  { name: \"Copperline\", icon: Wrench, style: \"font-medium tracking-[-0.01em]\" },\n  { name: \"Saltwater Coffee\", icon: Coffee, style: \"font-display italic font-medium\" },\n  { name: \"Ironside Gym\", icon: Dumbbell, style: \"font-bold uppercase tracking-[-0.02em]\" },\n];\n\nconst row2: Brand[] = [\n  { name: \"Mesa Realty\", icon: Key, style: \"font-display font-semibold tracking-[-0.02em]\" },\n  { name: \"Golden Hour Solar\", icon: Sun, style: \"font-medium tracking-[-0.01em]\" },\n  { name: \"Fade Society\", icon: Scissors, style: \"font-bold uppercase tracking-[0.12em] text-[13px]\" },\n  { name: \"Olive & Ember\", icon: Utensils, style: \"font-display italic font-semibold\" },\n  { name: \"Northline Builders\", icon: Home, style: \"font-semibold uppercase tracking-[0.06em] text-[13px]\" },\n];\n\nfunction Wordmark({ brand }: { brand: Brand }) {\n  return (\n    <span className=\"inline-flex items-center gap-2 whitespace-nowrap text-lg text-muted-foreground transition-colors duration-300 hover:text-foreground\">\n      <brand.icon className=\"size-5\" strokeWidth={1.75} />\n      <span className={brand.style}>{brand.name}</span>\n    </span>\n  );\n}\n\nexport default function Demo() {\n  return (\n    <section className=\"w-full max-w-3xl\">\n      <p className=\"text-center text-[15px] text-muted-foreground\">\n        Trusted by <span className=\"font-medium text-foreground\">340+ local businesses</span> across Texas and Colorado\n      </p>\n      <div className=\"mt-8 space-y-6\">\n        <Marquee speed={36} repeat={2}>\n          {row1.map((b) => (\n            <Wordmark key={b.name} brand={b} />\n          ))}\n        </Marquee>\n        <Marquee speed={42} direction=\"right\" repeat={2}>\n          {row2.map((b) => (\n            <Wordmark key={b.name} brand={b} />\n          ))}\n        </Marquee>\n      </div>\n    </section>\n  );\n}\n"}}