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

qrcode-nuxt

v1.0.0

Published

Highly customizable SVG QR code component and Nuxt module for Vue/Nuxt.

Readme


✦ Features

  • 13 data module styles — square, rounded, circle, heart, star, diamond, circuit-board, and more
  • 15 finder pattern styles — square, rounded, inpoint, outpoint, leaf, and more, independently for inner and outer rings
  • Gradient support — linear and radial gradients across all QR elements
  • Image embedding — embed logos or icons with optional excavation
  • Download API — export as SVG, PNG, or JPEG at any resolution via a component ref
  • Multi-segment values — encode multiple data segments in a single QR code
  • SSR ready — SVG renders server-side; download utilities safely gate on document
  • Nuxt auto-imports<VueQRCode />, <QrcodeNuxt />, and useQrcode with zero config
  • TypeScript first — fully typed props, composable options, and return values

Installation

# pnpm
pnpm add qrcode-nuxt

# npm
npm install qrcode-nuxt

# yarn
yarn add qrcode-nuxt

# bun
bun add qrcode-nuxt

Usage

Nuxt module

Register the module in your nuxt.config.ts — the component and composable are auto-imported everywhere:

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['qrcode-nuxt'],
})
<template>
  <VueQRCode value="https://nuxt.com" />
</template>

Vue (without Nuxt)

<script setup lang="ts">
import { VueQRCode } from 'qrcode-nuxt/runtime'
</script>

<template>
  <VueQRCode value="https://vuejs.org" />
</template>

Examples

Gradient

<template>
  <VueQRCode
    value="https://nuxt.com"
    level="H"
    :gradient="{
      type: 'linear',
      rotation: 135,
      stops: [
        { offset: '0%',   color: '#10b981' },
        { offset: '100%', color: '#3b82f6' },
      ],
    }"
  />
</template>

Custom data modules

<template>
  <VueQRCode
    value="https://nuxt.com"
    :data-modules-settings="{ style: 'rounded', color: '#10b981' }"
  />
</template>

Image embedding

<template>
  <VueQRCode
    value="https://nuxt.com"
    level="H"
    :image-settings="{
      src: '/logo.png',
      width: 40,
      height: 40,
      excavate: true,
    }"
  />
</template>

Download API

Expose the component via a template ref to call download():

<script setup lang="ts">
import type { QrCodeNuxt } from 'qrcode-nuxt/runtime'

const qr = useTemplateRef<QrCodeNuxt>('qr')
</script>

<template>
  <VueQRCode ref="qr" value="https://nuxt.com" level="H" />
  <button @click="qr?.download({ format: 'png', size: 800 })">Download PNG</button>
</template>

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | value | string \| string[] | Required | Data to encode. Pass an array for multi-segment QR codes. | | size | number | 128 | Rendered width and height in pixels. | | level | 'L' \| 'M' \| 'Q' \| 'H' | 'M' | Error correction level. H allows up to 30% damage. | | marginSize | number | 4 | Quiet-zone modules around the code (QR spec minimum is 4). | | minVersion | number | 1 | Minimum QR version (1–40). Higher versions store more data. | | boostLevel | boolean | true | Raise error correction when it fits without increasing version. | | background | string \| GradientSettings | '#FFFFFF' | Background fill. Omit or set undefined for transparent. | | gradient | GradientSettings | undefined | Gradient applied to all foreground elements. | | dataModulesSettings | DataModulesSettings | undefined | Style and color of the small data squares. | | finderPatternOuterSettings | FinderPatternOuterSettings | undefined | Outer ring of the three corner finder patterns. | | finderPatternInnerSettings | FinderPatternInnerSettings | undefined | Inner dot of the three corner finder patterns. | | imageSettings | ImageSettings | undefined | Embeds an image (e.g. a logo) inside the QR code. | | svgProps | Record<string, unknown> | undefined | Additional attributes forwarded to the root <svg> element. |


Supported styles

Data modules

square · square-sm · pinched-square · rounded · leaf · vertical-line · horizontal-line · circuit-board · circle · diamond · star · heart · hashtag

Outer finder patterns

square · pinched-square · rounded-sm · rounded · rounded-lg · circle · inpoint-sm · inpoint · inpoint-lg · outpoint-sm · outpoint · outpoint-lg · leaf-sm · leaf · leaf-lg

Inner finder patterns

All outer styles plus diamond · star · heart · hashtag · microchip


Download options

| Option | Type | Default | Description | | --- | --- | --- | --- | | format | 'svg' \| 'png' \| 'jpeg' | 'svg' | Output file format. | | size | number | 500 | Output size in pixels (raster formats). Ignored for SVG. | | name | string | 'qrcode-nuxt' | Filename without extension. |


Development

# Install dependencies
pnpm install

# Start the docs dev server
pnpm dev

# Build the module
pnpm build

Credits

The QR encoder is the MIT-licensed TypeScript QR Code generator by Project Nayuki. This library ports the public feature set of @lglab/react-qr-code to the Vue / Nuxt ecosystem.


License

MIT