Introducing Nuvyx UI v1.0.0

Docs
Image Scanner

Image Scanner

A dynamic component that applies interactive scanning effects to images, supporting various scan patterns, directions, and customizable animations.

Scanning image

Click to Scan

Scanning image

Repeating Scan

Scanning image

Button Triggered

Installation

Usage

import { ImageScanner } from "@/components/ui/image-scanner";
export default function MyComponent() {
  return (
    <div className="w-full max-w-md mx-auto">
      <h1 className="text-2xl font-bold mb-8 text-center">Horizontal Scan</h1>
      <ImageScanner
        image="/path-to-image.png"
        scanDirection="horizontal"
        scanColor="emerald"
        scanType="both"
        autoScan={true}
        repeating={true}
      />
    </div>
  );
}
 
// With scan completion callback
export function ScanWithCallback() {
  const handleScanComplete = () => {
    console.log("Scan completed!");
    // Perform actions after scan completes
  };
 
  return (
    <div className="w-full max-w-md mx-auto">
      <h1 className="text-2xl font-bold mb-8 text-center">
        Scan with callback
      </h1>
      <ImageScanner
        image="/path-to-image.png"
        scanDirection="vertical"
        scanColor="blue"
        scanType="line"
        onScanComplete={handleScanComplete}
      />
    </div>
  );
}

Props

Image Scanner

PropTypeDefaultDescription
imagestringundefinedURL or path to the image to be scanned.
altstring"Scanning image"Alternative text for the image.
scanDirection"horizontal" | "vertical""horizontal"Direction of the scanning effect.
scanSpeednumber2Speed of the scanning animation in seconds.
scanColor"emerald" | "blue" | "purple" | "amber" | "red""emerald"Color of the scanning effect.
scanType"line" | "corners" | "both""both"Type of scanning visual effect to display.
classNamestringundefinedAdditional CSS classes to apply to the container.
onScanComplete() => voidundefinedCallback function triggered when scanning is complete.
autoScanbooleanfalseAutomatically start scanning when component mounts.
scanDelaynumber0Delay in seconds before starting the auto scan.
scanAtScrollbooleanfalseTrigger scan when component is scrolled into view.
repeatingbooleanfalseEnable repeated scanning in a loop.
triggerScanbooleanfalseExternally trigger the scanning effect.