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

@rific/scanner

v0.1.5

Published

Full-screen barcode scanner with animated overlays, pinch zoom, timeout ring, and scan tracking for React Native

Readme

@rific/scanner

Full-screen barcode scanner with animated overlays, pinch zoom, timeout ring, and scan tracking for React Native. Uses expo-camera for barcode scanning when installed.

Installation

npm install @rific/scanner react-native-gesture-handler react-native-reanimated react-native-svg expo-camera

Optional (for richer UI):

npm install react-native-paper react-native-safe-area-context

Usage

import { Scanner } from '@rific/scanner'

<Scanner
  accentColor='#6200ee'
  autoScan
  timeout={30}
  onScan={({ data, type }) => console.log(data, type)}
  onClose={() => navigation.goBack()}
  onSound={() => playBoop()}
  onVibrate={() => vibrate()}
  onTimeout={() => navigation.goBack()}
/>

With custom menu

import { Scanner, MenuBag } from '@rific/scanner'

<Scanner
  onScan={handleScan}
  renderMenu={({ facing, setFacing, torch, setTorch }: MenuBag) => (
    <MyMenu
      facing={facing}
      onFacingToggle={() => setFacing(facing === 'back' ? 'front' : 'back')}
      torch={torch}
      onTorchToggle={() => setTorch(!torch)}
    />
  )}
/>

Props

| Prop | Type | Default | Description | |---|---|---|---| | onScan | (result: ScanResult) => void | required | Called with { data, type } for each captured scan | | accentColor | string | '#6200ee' | Color for overlays, timer ring, and buttons | | autoScan | boolean | true | Auto-capture on detect; false = manual press | | backgroundColor | string | 'black' | Camera background color | | barcodeTypes | string[] | all | Barcode types to detect (e.g. ['qr', 'ean13']) | | children | ReactNode | | Rendered over the camera | | disabledScanValues | string[] | | Values to show as already-scanned (checked state) | | disabledScanValueSet | ReadonlySet<string> | | Set version of disabledScanValues (preferred for large lists) | | onClose | () => void | | Shows a close button; called on press | | onDisabledScan | (value: string) => void | | Called when a disabled value is pressed | | onPermissionDenied | () => void | | Called when camera permission is denied | | onSound | () => void | | Called on successful scan — play a sound here | | onTimeout | () => void | | Called when the timeout ring completes | | onVibrate | () => void | | Called on successful scan — trigger haptics here | | renderMenu | (bag: MenuBag) => ReactNode | | Render a custom menu (torch, facing, etc.) | | scanTimeout | number | 0 | Seconds before a scanned value reverts to unscanned; 0 = never | | style | ViewStyle | | Style for the camera view | | timeout | number | 0 | Seconds before onTimeout/onClose fires; 0 = no timeout |

ScanResult

type ScanResult = {
  data: string   // barcode value
  type: string   // barcode format (e.g. 'QR', 'EAN13')
}

MenuBag

type MenuBag = {
  barcodeTypes: string[]
  facing: 'front' | 'back'
  setFacing: (facing: 'front' | 'back') => void
  setTorch: (torch: boolean) => void
  torch: boolean
}

Peer dependencies

Required:

  • react >= 17.0.0
  • react-native >= 0.70.0
  • react-native-gesture-handler >= 2.0.0
  • react-native-reanimated >= 3.0.0
  • react-native-svg >= 13.0.0

Optional:

  • expo-camera >= 15.0.0 — barcode scanning; without it the camera renders as a blank view
  • react-native-paper >= 5.0.0 — richer UI (icon buttons, Portal); without it falls back to simple Pressable elements
  • react-native-safe-area-context >= 4.0.0 — proper notch/safe area handling; without it falls back to a fixed iOS top padding