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 🙏

© 2024 – Pkg Stats / Ryan Hefner

qr-code-woven

v0.5.0

Published

QrCodeWoven is a library that facilitates qr code generation in react/next.js using the qrious library.

Downloads

15

Readme

QrCodeWoven

The QrCodeWoven is a React component based on qrious package that allows for easy generation of QR codes within your React applications. It provides the flexibility to generate qr codes as either canvas elements or images, customizable with a variety of options to fit the needs of your application.

Installation

Ensure you have React installed. Then, integrate the QrCodeWoven component into your project by placing it in your components directory or wherever you manage external libraries.

Installation with npm

npm install qr-code-woven

Installation with yarn

yarn add qr-code-woven

Installation with pnpm

pnpm add qr-code-woven

Usage

First, import the QrCodeWoven component into your React component file where you intend to display the QR code.

import { QrCodeWoven } from 'qr-code-woven';

Then, you can use the QrCodeWoven component within your component's render method or function component return statement. Here is a basic example:

const YourComponent = () => {
  return (
    <QrCodeWoven
      type='canvas'
      value='https://example.com'
      options={{
        background: '#eaeaea',
        backgroundAlpha: 1,
        foreground: 'black',
        foregroundAlpha: 1,
        level: 'L',
        mime: 'image/png',
        padding: 25,
        size: 100,
      }}
    />
  );
};

Props

The QrCodeWoven component accepts the following props:

  • value (String): The value you wish to encode within the QR code. This is typically a URL or any text.
  • type (String): Determines the type of QR code to generate. Options are canvas or image.
  • options (Object): A set of options to customize the QR code's appearance and functionality. These options are passed directly to QRious and include:
    • background (String): The background color of the QR code. Defaults to "white".
    • backgroundAlpha (Number): The background alpha (transparency) of the QR code. Defaults to 1.0.
    • foreground (String): The foreground color of the QR code. Defaults to "black".
    • foregroundAlpha (Number): The foreground alpha (transparency) of the QR code. Defaults to 1.0.
    • level (String): The error correction level of the QR code. Options are L, M, Q, H. Defaults to "L".
    • mime (String): The MIME type used to render the image for the QR code. Defaults to "image/png".
    • padding (Number): The padding around the QR code in pixels. A null value defaults to automatic padding.
    • size (Number): The size of the QR code in pixels. Defaults to 100.

For more detailed information on the options, refer to the QRious API reference.

License

See LICENSE.md for more information on our MIT license.

This project uses a library called qrious licensed under the GNU GPLv3. For more information, follow the link: https://github.com/neocotic/qrious.