npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

qrbar-react-pack

v1.0.3

Published

React/Next universal QR & barcode scanner with native BarcodeDetector, separate styles, clipboard + toast

Readme

qrbar-react-pack

کامپوننت اسکنر QR و بارکد برای React/Next با API بومی BarcodeDetector. بدون وابستگی دیکودر خارجی، با کپی خودکار نتیجه به کلیپ‌بورد و Toast فارسی.

نصب

npm i qrbar-react-pack react-hot-toast

استفاده در Next.js

'use client';
import dynamic from 'next/dynamic';
import { Toaster } from 'react-hot-toast';
import { QRBarcodeScanner } from 'qrbar-react-pack';

const Scanner = dynamic(async () => (await import('qrbar-react-pack')).QRBarcodeScanner as any, { ssr: false });

export default function Page() {
  return (
    <div style={{ minHeight: '100vh', background: '#0a0a0a', color: '#e5e5e5', padding: 24, display: 'grid', placeItems: 'center' }}>
      <Toaster />
      <div style={{ width: '100%', maxWidth: 420 }}>
        <Scanner
          onDetected={(res) => console.log('RESULT', res)}
          onError={(e) => console.error(e)}
          facingMode="environment"
          qrStyle={{ borderColor: '#3b82f6' }}
          barcodeStyle={{ borderColor: '#10b981' }}
          showTorchButton
          copyToClipboard
          copyToastText="کپی شد"
        />
      </div>
    </div>
  );
}

پراپ‌ها

| نام | نوع | پیش‌فرض | توضیح | |---|---|---|---| | onDetected | (result) => void | undefined | کال‌بک هنگام تشخیص | | onError | (err) => void | undefined | گزارش خطا | | className | string | undefined | کلاس‌های اضافی کانتینر | | paused | boolean | false | توقف موقت اسکن | | scanIntervalMs | number | 120 | فاصله‌ی اسکن | | formats | BarcodeFormat[] | مجموعهٔ متداول | فرمت‌های مجاز | | facingMode | 'environment'|'user' | 'environment' | انتخاب دوربین | | constraints | MediaTrackConstraints | undefined | محدودیت‌های اضافی | | qrStyle | OverlayStyle | آبی | استایل QR | | barcodeStyle | OverlayStyle | سبز | استایل بارکد | | showTorchButton | boolean | true | دکمهٔ فلش در صورت پشتیبانی | | torchLabel | string | 'روشنایی' | برچسب فلش | | unsupportedFallback | ReactNode | پیام پیش‌فرض | جایگزین برای عدم پشتیبانی | | fallbackDecoder | (ImageBitmap|ImageData)=>Promise<ScanResult|null> | undefined | دیکودر جایگزین سفارشی | | copyToClipboard | boolean | true | کپی خودکار مقدار | | copyToastText | string | 'کپی شد' | متن Toast |

ساخت

npm run build

نکات

  • HTTPS و مجوز دوربین لازم است.
  • اگر BarcodeDetector در مرورگر کاربر پشتیبانی نشود، از fallbackDecoder استفاده کنید.
  • برای نمایش Toast باید react-hot-toast نصب و Toaster در ریشهٔ UI قرار گیرد.

لایسنس

MIT