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

@npm_lx/signature-pad-for-vue3

v0.1.7

Published

A Vue3 signature pad component based on [signature_pad](https://github.com/szimek/signature_pad), supporting custom styles and multiple export formats, easy to use, suitable for user signatures, contract signatures, etc. Background images can be changed a

Downloads

285

Readme

@npm_lx/signature-pad-for-vue3

A Vue3 signature pad component based on signature_pad, supporting custom styles and multiple export formats, easy to use, suitable for user signatures, contract signatures, etc. Background images can be changed at any time.

Other Languages Document

Installation

npm install @npm_lx/signature-pad-for-vue3

Component Preview

To preview the component, you need to clone the project from GitHub and run the following commands in the project root directory:

pnpm install
pnpm run dev

Basic Usage

<template>
  <div class="signature-container">
    <SignaturePad
      ref="signaturePadRef"
      :penMinWidth="2"
      :penMaxWidth="5"
      :penColor="'#000000'"
      :backgroundColor="'#F3F3F4'"
      @beginStroke="handleBeginStroke"
      @endStroke="handleEndStroke"
    />
    <div class="signature-actions">
      <button @click="clearSignature">Clear</butto
      <button @click="undoSignature">Undo</button>
      <button @click="redoSignature">Redo</button>
      <button @click="saveSignature">Save</button>
      <button @click="exportImage">Export Image</button>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import SignaturePad from '@npm_lx/signature-pad-for-vue3'

const signaturePadRef = ref(null)

const handleBeginStroke = () => {
  console.log('Begin signing')
}

const handleEndStroke = () => {
  console.log('End signing')
}

const clearSignature = () => {
  signaturePadRef.value.clear()
}

const saveSignature = () => {
  const base64Data = signaturePadRef.value.getBase64Data()
  if (base64Data) {
    console.log('Signature data:', base64Data)
    // You can send base64Data to the server for storage
  }
}

const exportImage = () => {
  signaturePadRef.value.getImageFile()
}

const undoSignature = () => {
  signaturePadRef.value.undo()
}

const redoSignature = () => {
  signaturePadRef.value.redo()
}
</script>

<style scoped>
.signature-container {
  width: 400px;
  height: 300px;
  border: 1px solid #ccc;
  margin: 0 auto;
}

.signature-actions {
  margin-top: 20px;
  text-align: center;
}

button {
  margin: 0 10px;
  padding: 8px 16px;
  cursor: pointer;
}
</style>

Props

| Prop Name | Type | Default Value | Description | | --- | --- | --- | --- | | penMinWidth | Number | 2 | Minimum width of the pen stroke | | penMaxWidth | Number | 2 | Maximum width of the pen stroke | | penColor | String | '#000000' | Color of the pen stroke | | backgroundColor | String | '#F3F3F4' | Background color of the signature pad | | bgImageUrl | String | '' | URL of the background image (for signature preview) | | watermark | Object | {} | Watermark configuration parameters, default values see Watermark Configuration |

Default Watermark Parameters

When you want to add a watermark, remember to pass a string for the text parameter to enable the watermark, otherwise no watermark will be added if the text value is empty.

{
  // Watermark text
  text: '', 
  // Font size
  fontSize: 20,
  // Line height
  lineHeight: 24,
  // Font family
  fontFamily: 'Arial',
  // Font weight
  fontWeight: 'bold',
  // Font color
  color: 'rgba(0, 0, 0, 0.1)',
  // Rotation angle
  rotate: -45,
  // Watermark starting x coordinate
  x: 100,
  // Watermark starting y coordinate
  y: 100,
  // Distance between watermarks when repeating x y
  textDistanceX: 0,
  textDistanceY: 0,
  // Whether to repeat the watermark across the entire canvas
  repeat: true,
}

Methods

| Method Name | Parameters | Return Value | Description | | --- | --- | --- | --- | | clear | isClearBg: Boolean (default: false) | None | Clear the signature pad, if isClearBg is true, also clear the background image | | getBase64Data | format: String (default: 'png'), quality: Number (default: 0.95) | String | Get the signature as Base64 data | | getImageFile | format: String (default: 'png'), quality: Number (default: 0.95) | None | Export the signature as an image file | | setBgImage | url: String | None | Set the background image | | isCanvasEmpty | None | Boolean | Check if the canvas is empty | | undo | None | None | Undo the last stroke | | redo | None | None | Redo the last undone stroke |

Events

| Event Name | Description | | --- | --- | | beginStroke | Triggered when starting to sign | | endStroke | Triggered when finishing signing |

Notes

  1. The component needs a container with fixed width and height to display
  2. Use ref to call the component's methods
  3. Using background images requires cross-origin support from the source
  4. Exported image formats support common formats like png, jpg, etc.