All components

Animated Beam, One Way

Animated Beam, One Way is a React and Tailwind CSS effect component from UI Layouts, licensed MIT. Copy it and paste it into your project.

UI Layouts MIT effects

What it is

Animated Beam, One Way is a React and Tailwind CSS effect component from UI Layouts, licensed MIT. Copy it and paste it into your project.

How to use it

Open it in the catalogue, press copy, and paste it into your project. The prompt you copy carries the code and the rules that tell your agent to reproduce it without changing anything.

Open in the catalogue

Five free copies a month. No card.

No packages beyond the project baseline

Licence

This component comes from UI Layouts and is redistributed under the MIT licence, which permits commercial use. The copyright notice travels with the code.

Animated Beam, One Way

./registry/components/animated-beam/unidirectional.tsx
'use client';

import { AnimatedBeam, Circle, Icons } from '@/components/ui/animated-beam';
import { cn } from '@/lib/utils';
import React, { forwardRef, useRef } from 'react';

export default function AnimatedBeamUnidirectional() {
  const containerRef = useRef<HTMLDivElement>(null);
  const div1Ref = useRef<HTMLDivElement>(null);
  const div2Ref = useRef<HTMLDivElement>(null);

  return (
    <div
      className='relative flex w-full max-w-[500px] mx-auto items-center justify-center overflow-hidden rounded-lg border dark:bg-neutral-800 bg-neutral-50 lg:p-10 sm:p-4 p-2 md:shadow-xl'
      ref={containerRef}
    >
      <div className='flex h-full w-full flex-col items-stretch justify-between gap-10'>
        <div className='flex flex-row justify-between'>
          <Circle className='p-2' ref={div1Ref}>
            <Icons.logo />
          </Circle>
          <Circle ref={div2Ref}>
            <Icons.user />
          </Circle>
        </div>
      </div>

      <AnimatedBeam
        duration={3}
        containerRef={containerRef}
        fromRef={div1Ref}
        toRef={div2Ref}
        dotted
        dotSpacing={5}
      />
    </div>
  );
}

Similar components