qrious vs vue-qr
QR Code Generation Libraries Comparison
1 Year
qriousvue-qrSimilar Packages:
What's QR Code Generation Libraries?

QR code generation libraries are tools that allow developers to create QR codes programmatically. These libraries provide functionalities to customize the appearance of QR codes, encode various types of data, and integrate seamlessly into web applications. They are essential for applications that require quick access to information through mobile devices, such as URLs, contact information, or product details.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
qrious43,6871,574-428 years agoGPL-3.0
vue-qr10,0178605.28 MB39-MIT
Feature Comparison: qrious vs vue-qr

Integration

  • qrious:

    Qrious is designed to be lightweight and can be easily integrated into any JavaScript project. It does not depend on any other libraries, making it a great choice for projects that require minimal overhead and straightforward implementation.

  • vue-qr:

    vue-qr is specifically built for Vue.js applications, allowing for easy integration with Vue components. It takes advantage of Vue's reactive data binding, making it simple to update QR codes in real-time as data changes.

Customization

  • qrious:

    Qrious allows for basic customization of QR codes, including size, level of error correction, and the type of data encoded. However, it has limited options for styling the QR code beyond its basic parameters.

  • vue-qr:

    vue-qr offers extensive customization options, allowing developers to style QR codes using CSS and customize their appearance directly within Vue components. This makes it easier to match the QR code's design with the overall application theme.

Performance

  • qrious:

    Qrious is optimized for performance, generating QR codes quickly in the browser without significant delays. It is particularly efficient for generating static QR codes that do not require frequent updates.

  • vue-qr:

    vue-qr is also performant, but its efficiency shines in dynamic scenarios where the QR code needs to be updated based on user interactions. Its reactive nature ensures that updates are handled smoothly without unnecessary re-renders.

Ease of Use

  • qrious:

    Qrious is straightforward to use, with a simple API that allows developers to create QR codes with minimal code. This makes it accessible for developers of all skill levels, especially those who need a quick solution.

  • vue-qr:

    vue-qr is user-friendly for Vue developers, providing a declarative syntax that fits naturally within Vue's component-based architecture. It simplifies the process of generating QR codes in Vue applications.

Documentation and Community Support

  • qrious:

    Qrious has decent documentation that covers the basic usage and examples. However, its community support may not be as extensive as larger libraries, which could be a consideration for troubleshooting and advanced use cases.

  • vue-qr:

    vue-qr benefits from the larger Vue.js community, offering extensive documentation, examples, and community support. This can be advantageous for developers looking for help or resources when implementing QR code generation in their Vue applications.

How to Choose: qrious vs vue-qr
  • qrious:

    Choose Qrious if you need a lightweight and straightforward solution for generating QR codes without additional dependencies. It is ideal for projects where simplicity and ease of use are prioritized, and you want to generate QR codes directly in the browser without server-side processing.

  • vue-qr:

    Choose vue-qr if you are working within a Vue.js framework and need a more integrated solution that leverages Vue's reactivity. It is suitable for applications that require dynamic QR code generation based on user input or data changes, providing a more seamless experience in Vue applications.

README for qrious
 .d88888b.  8888888b.  d8b
d88P" "Y88b 888   Y88b Y8P
888     888 888    888
888     888 888   d88P 888  .d88b.  888  888 .d8888b
888     888 8888888P"  888 d88""88b 888  888 88K
888 Y8b 888 888 T88b   888 888  888 888  888 "Y8888b.
Y88b.Y8b88P 888  T88b  888 Y88..88P Y88b 888      X88
 "Y888888"  888   T88b 888  "Y88P"   "Y88888  88888P'
       Y8b

QRious is a pure JavaScript library for generating QR codes using HTML5 canvas.

Chat Demo Dev Dependency Status License Release

Install

Install using the package manager for your desired environment(s):

$ npm install --save qrious
# OR:
$ bower install --save qrious

If you want to simply download the file to be used in the browser you can find them below:

Check out node-qrious if you want to install it for use within Node.js.

Examples

<!DOCTYPE html>
<html>
  <body>
    <canvas id="qr"></canvas>

    <script src="/path/to/qrious.js"></script>
    <script>
      (function() {
        var qr = new QRious({
          element: document.getElementById('qr'),
          value: 'https://github.com/neocotic/qrious'
        });
      })();
    </script>
  </body>
</html>

Open up demo.html in your browser to play around a bit.

API

Simply create an instance of QRious and you've done most of the work. You can control many aspects of the QR code using the following fields on your instance:

| Field | Type | Description | Default | Read Only | | --------------- | ------- | -------------------------------------------------- | ------------- | --------- | | background | String | Background color of the QR code | "white" | No | | backgroundAlpha | Number | Background alpha of the QR code | 1.0 | No | | element | Element | Element to render the QR code | <canvas> | Yes | | foreground | String | Foreground color of the QR code | "black" | No | | foregroundAlpha | Number | Foreground alpha of the QR code | 1.0 | No | | level | String | Error correction level of the QR code (L, M, Q, H) | "L" | No | | mime | String | MIME type used to render the image for the QR code | "image/png" | No | | padding | Number | Padding for the QR code (pixels) | null (auto) | No | | size | Number | Size of the QR code (pixels) | 100 | No | | value | String | Value encoded within the QR code | "" | No |

var qr = new QRious();
qr.background = 'green';
qr.backgroundAlpha = 0.8;
qr.foreground = 'blue';
qr.foregroundAlpha = 0.8;
qr.level = 'H';
qr.padding = 25;
qr.size = 500;
qr.value = 'https://github.com/neocotic/qrious';

The QR code will automatically update when you change one of these fields, so be wary when you plan on changing lots of fields at the same time. You probably want to make a single call to set(options) instead as it will only update the QR code once:

var qr = new QRious();
qr.set({
  background: 'green',
  backgroundAlpha: 0.8,
  foreground: 'blue',
  foregroundAlpha: 0.8,
  level: 'H',
  padding: 25,
  size: 500,
  value: 'https://github.com/neocotic/qrious'
});

These can also be passed as options to the constructor itself:

var qr = new QRious({
  background: 'green',
  backgroundAlpha: 0.8,
  foreground: 'blue',
  foregroundAlpha: 0.8,
  level: 'H',
  padding: 25,
  size: 500,
  value: 'https://github.com/neocotic/qrious'
});

You can also pass in an element option to the constructor which can be used to generate the QR code using an existing DOM element, which is the only time that you can specify read only options. element must either be a <canvas> element or an <img> element which can then be accessed via the canvas or image fields on the instance respectively. An element will be created for whichever one isn't provided or for both if no element is specified, which means that they can be appended to the document at a later time.

var qr = new QRious({
  element: document.querySelector('canvas'),
  value: 'https://github.com/neocotic/qrious'
});

qr.canvas.parentNode.appendChild(qr.image);

A reference to the QRious instance is also stored on both of the elements for convenience.

var canvas = document.querySelector('canvas');
var qr = new QRious({
  element: canvas,
  value: 'https://github.com/neocotic/qrious'
});

qr === canvas.qrious;
//=> true

toDataURL([mime])

Generates a base64 encoded data URI for the QR code. If you don't specify a MIME type, it will default to the one passed to the constructor as an option or the default value for the mime option.

var qr = new QRious({
  value: 'https://github.com/neocotic/qrious'
});

qr.toDataURL();
//=> "data:image/png;base64,iVBOR...AIpqDnseH86KAAAAAElFTkSuQmCC"
qr.toDataURL('image/jpeg');
//=> "data:image/jpeg;base64,/9j/...xqAqIqgKFAAAAAq3RRQAUUUUAf/Z"

Migrating from older versions

If you've been using an older major version and would like details on what's changed and information on how to migrate to the latest major release below:

https://github.com/neocotic/qrious/wiki/Migrating-from-older-versions

Bugs

If you have any problems with QRious or would like to see changes currently in development you can do so here. Core features and issues are maintained separately here.

Contributors

If you want to contribute, you're a legend! Information on how you can do so can be found in CONTRIBUTING.md. We want your suggestions and pull requests!

A list of QRious contributors can be found in AUTHORS.md.

License

Copyright © 2017 Alasdair Mercer
Copyright © 2010 Tom Zerucha

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