DocsMarquee

Marquee

Very useful while showcasing comments or technologies

Motion
Motion

Installation

update tailwind.config.ts file

const config= {
  //...
  theme: {
    extend: {
      animation: {
        marquee: 'marquee var(--duration, 30s) linear infinite'
      },
      keyframes: {
        marquee: {
          to: { transform: 'translateX(-50%)' }
        }
      }
    }
  }
  //...
}

Create Marquee component

export const Marquee: React.FC<{ children: React.ReactNode }> = ({ children }) => {
  return (
    <div className="w-full overflow-hidden sm:mt-24 mt-10 z-10">
      <div className="relative flex max-w-[90vw] overflow-hidden py-5">
        <div className="flex w-max animate-marquee [--duration:30s]">
          {children}
          {children}
        </div>
      </div>
    </div>
  )
}