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

embroidery-qc-image

v1.0.37

Published

React component for rendering embroidery QC images

Readme

embroidery-qc-image

React component for rendering embroidery qc image. This package allows you to display custom embroidered designs on product mockups with configurable text, icons, colors, and fonts.

Installation

npm install embroidery-qc-image

Usage

import React from "react";
import { EmbroideryQCImage } from "embroidery-qc-image";
import type { EmbroideryQCConfig } from "embroidery-qc-image";

const exampleConfig: EmbroideryQCConfig = {
  image_url:
    "https://i.etsystatic.com/34592503/r/il/5d3e59/7253371633/il_fullxfull.7253371633_kgqr.jpg",
  sides: [
    {
      print_side: "Chest",
      positions: [
        {
          type: "TEXT",
          text: "Brian",
          text_shape: "No Curved",
          color: null,
          font: "Brittany Signature",
          floral_pattern: null,
          character_colors: ["Pink (1148)", "Lavender (1032)"],
        },
        {
          type: "TEXT",
          text: "EST. 2009",
          text_shape: "No Curved",
          color: "Light Denim (1133)",
          font: "Arial",
          character_colors: null,
          floral_pattern: "P61",
        },
        {
          type: "ICON",
          icon: 1,
          layer_colors: ["White (9)", "Red (1037)"],
        },
      ],
    },
    {
      print_side: "Sleeve",
      positions: [
        {
          type: "TEXT",
          text: "Ayanna",
          text_shape: "No Curved",
          color: "Terra Cotta (1477)",
          font: "Blackmate",
          character_colors: null,
        },
        {
          type: "TEXT",
          text: "Ryan",
          text_shape: "No Curved",
          color: "Terra Cotta (1477)",
          font: "Millie",
          character_colors: null,
        },
      ],
    },
  ],
};

const App: React.FC = () => {
  return (
    <div style={{ padding: "20px", maxWidth: "800px", margin: "0 auto" }}>
      <EmbroideryQCImage config={exampleConfig} />
    </div>
  );
};

export default App;

Export as Data URL

If you want to render the embroidery image yourself (for example with an <img> tag, download button, or upload flow), use the helper generateEmbroideryQCImageData. It returns a Data URL corresponding to the canvas output.

import { generateEmbroideryQCImageData } from "embroidery-qc-image";

const dataUrl = await generateEmbroideryQCImageData(exampleConfig, {
  width: 4200,        // optional, defaults to 4200
  height: 4800,       // optional, defaults to 4800
  mimeType: "image/png", // optional
  quality: 0.92          // optional (used for jpeg/webp)
});

if (dataUrl) {
  // Display in an <img> tag
  <img src={dataUrl} alt="Embroidery preview" />;
  
  // Or trigger download
  const link = document.createElement("a");
  link.href = dataUrl;
  link.download = "embroidery.png";
  link.click();
}

Need a Blob instead? Use generateEmbroideryQCImageBlob with the same options.

Props

EmbroideryQCImage

| Prop | Type | Required | Description | |------|------|----------|-------------| | config | EmbroideryQCConfig | Yes | Configuration object containing embroidery details | | className | string | No | Additional CSS classes | | style | React.CSSProperties | No | Inline styles |

Configuration Structure

EmbroideryQCConfig

export interface TextPosition {
  type: 'TEXT';
  text: string;
  text_shape?: string | null;
  color?: string | null;
  font?: string | null;
  is_font_default?: boolean | null;
  character_colors?: string[] | null;
  floral_pattern?: string | null;
}

export interface IconPosition {
  type: 'ICON';
  icon: number;
  color?: string | null;
  layer_colors: string[];
}

export type Position = TextPosition | IconPosition;

export interface Side {
  print_side: string;
  positions: Position[];
}

export interface EmbroideryQCConfig {
  image_url?: string;
  error_message?: string | null;
  warning_message?: string | null;
  sides: Side[];
}

export interface EmbroideryQCImageProps {
  config: EmbroideryQCConfig;
  className?: string;
  style?: React.CSSProperties;
}

License

MIT

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

Support

For issues and questions, please open an issue on GitHub.