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

signetpad

v0.1.0

Published

SignetPad is a headless TypeScript signature pad for React, Vue, Svelte, and React Native. Capture vector signatures, undo strokes, and export SVG, PNG, JPEG, or WebP.

Downloads

161

Readme

SignetPad

CI npm License: MIT

SignetPad is a headless TypeScript signature pad for React, Next.js, Vue, Nuxt, Svelte, SvelteKit, and React Native. It captures handwritten signatures as versioned vector data, supports undo and redo, and exports SVG or browser images (PNG, JPEG, WebP).

Install one package. Import only the entry you need so unused framework code is tree-shaken away.

pnpm add signetpad
npm install signetpad

Why SignetPad

Most signature pad libraries bind capture, drawing, and export to one canvas. SignetPad keeps those jobs separate:

  • Capture once with a tiny framework adapter
  • Persist editable SignatureData instead of a screenshot
  • Render with Canvas, React Native SVG, or your own surface
  • Use the same payload on web, native, and the server

Import paths

| Import | Use it for | | ---------------------------- | --------------------------------------------------------------- | | signetpad | Headless controller, history, validation, toData(), toSvg() | | signetpad/react | React SignaturePad plus the headless useSignaturePad hook | | signetpad/vue | Vue SignaturePad plus the composable | | signetpad/svelte | Svelte action that paints a canvas for you | | signetpad/react-native | React Native PanResponder hook | | signetpad/react-native-svg | Native SignaturePad plus SignatureSvg | | signetpad/canvas | Canvas 2D renderer (used internally by the web SignaturePad) |

sideEffects is false. Importing signetpad/react does not load Vue, Svelte, or React Native.

React signature pad

import { SignaturePad } from 'signetpad/react';

export function SignatureField() {
  return <SignaturePad aria-label="Agreement signature" />;
}

Add undo without assembling a renderer:

import { useRef } from 'react';
import { SignaturePad, type SignaturePadHandle } from 'signetpad/react';

export function SignatureField() {
  const padRef = useRef<SignaturePadHandle>(null);

  return (
    <>
      <SignaturePad ref={padRef} aria-label="Agreement signature" />
      <button type="button" onClick={() => padRef.current?.undo()}>
        Undo
      </button>
    </>
  );
}

Works in React 18+, Next.js client components, Remix, Vite, and Astro islands.

Vue signature pad

<script setup lang="ts">
import { SignaturePad } from 'signetpad/vue';
</script>

<template>
  <SignaturePad aria-label="Agreement signature" />
</template>

Svelte signature pad

<script lang="ts">
  import { createSignaturePadAction } from 'signetpad/svelte';

  const { action, controller, snapshot } = createSignaturePadAction();
</script>

<canvas use:action aria-label="Agreement signature"></canvas>
<button type="button" disabled={!$snapshot.canUndo} on:click={() => controller.undo()}>
  Undo
</button>

React Native signature pad

import { SignaturePad } from 'signetpad/react-native-svg';

export function SignatureField() {
  return <SignaturePad accessibilityLabel="Agreement signature" />;
}

react, vue, react-native, and react-native-svg are optional peer dependencies. Install only the ones your app already uses.

Save, restore, and export

import { useRef } from 'react';
import { SignaturePad, type SignaturePadHandle } from 'signetpad/react';

export function SignatureField() {
  const padRef = useRef<SignaturePadHandle>(null);

  function persist() {
    const data = padRef.current?.toData();
    const svg = padRef.current?.toSvg({ background: '#ffffff' });
    const png = padRef.current?.toDataURL({ type: 'image/png' });
    return { data, svg, png };
  }

  return <SignaturePad ref={padRef} aria-label="Agreement signature" />;
}

Keep toData() as the source of truth. Use toSvg() when you need a portable image without a browser encoder.

Tree shaking

Each import path is a separate ESM entry. The core does not import React, Vue, or React Native. Renderers import types only, so a Canvas-only bundle does not include the controller unless you import signetpad yourself.

import { createSignaturePad } from 'signetpad';
import { useSignaturePad } from 'signetpad/react';
import { createCanvasRenderer } from 'signetpad/canvas';

Do not import from a barrel of every adapter. There is no signetpad/all on purpose.

Docs and examples

License

MIT