All components

Demo Spotlight Card2

Demo Spotlight Card2 is a React and Tailwind CSS background component from UI Layouts, licensed MIT. Copy it and paste it into your project.

UI Layouts MIT backgrounds

What it is

Demo Spotlight Card2 is a React and Tailwind CSS background 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.

Demo Spotlight Card2

./registry/components/spotlight-cards/demo-spotlight-card2.tsx
// @ts-nocheck
'use client';

// // https://buildui.com/recipes/spotlight

import { cn } from '@/lib/utils';
import Image from 'next/image';
import React, { type MouseEvent, useRef, useState } from 'react';

export default function DemoSpotlightCard2() {
  const boxWrapper = useRef(null);
  const [overlayColor, setOverlayColor] = useState({ x: 0, y: 0 });
  const handleMouemove = ({ currentTarget, clientX, clientY }): MouseEvent => {
    const { left, top } = currentTarget.getBoundingClientRect();

    const x = clientX - left;
    const y = clientY - top;

    setOverlayColor({ x, y });
  };

  return (
    <>
      <div
        onMouseMove={handleMouemove}
        ref={boxWrapper}
        className={`group relative rounded-lg border-2 bg-black   overflow-hidden w-fit mx-auto`}
      >
        <div
          className='pointer-events-none absolute opacity-0 z-50 rounded-lg w-full h-full group-hover:opacity-100  transition duration-300 '
          style={{
            background: `
            radial-gradient(
              250px circle at ${overlayColor.x}px ${overlayColor.y}px,
              rgba(255, 255, 255, 0.137),
              transparent 80%
            )
          `,
          }}
        />

        <div className="relative text-center z-10 px-0 py-16 rounded-lg w-fit   bg-[url('https://res.cloudinary.com/dzl9yxixg/image/upload/new-grid_ng16tf.png')] bg-cover  bg-black h-full mx-auto">
          <>
            <Image
              src={'https://res.cloudinary.com/dzl9yxixg/image/upload/chat_se21ao.png'}
              alt='grid'
              width={600}
              className='mx-auto w-[85%]'
              height={600}
            />
            <h1 className='text-xl font-semibold tracking-tight text-white'>
              Create Group Effortlessly
            </h1>
            <p className='pt-2  lg:text-base text-sm  text-neutral-300 capitalize'>
              Seamless chats, crystal-clear videos, and <br />
              premium audio quality
            </p>
          </>
        </div>
      </div>
    </>
  );
}

Similar components