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

have-wcag

v1.0.0

Published

WCAG accessibility toolkit - Widget for users

Readme

have-wcag

A comprehensive WCAG accessibility toolkit with two tools:

  1. Widget — End-user accessibility controls (for production & development)
  2. Auditor — Developer accessibility auditing tool (for development only)

Features

Widget (End-User Tool)

  • 📏 Text Size — Increase/decrease font size
  • 🌓 High Contrast — Toggle high contrast mode
  • 🌙 Dark Mode — Invert colors for dark mode
  • 🔤 Dyslexia Font — OpenDyslexic font for easier reading
  • ↕️ Line Spacing — Adjust line height
  • 🔗 Link Highlighting — Make links more visible
  • 🖱️ Cursor Size — Small/medium/large cursor
  • 📖 Reading Guide — Horizontal ruler that follows cursor

Auditor (Developer Tool)

  • Color contrast checking (WCAG 1.4.3, 1.4.6)
  • Keyboard navigation testing (WCAG 2.1.1, 2.4.3)
  • Text resize checking (WCAG 1.4.4)
  • Visual issue highlighting
  • Fix suggestions with CSS output

Installation

npm install have-wcag

Usage

Production (Widget Only)

import { widget } from "have-wcag";

widget.init({
  position: "bottom-right",
  theme: {
    primaryColor: "#1a1a2e",
    accentColor: "#007bff",
  },
});

Or via script tag:

<script src="https://unpkg.com/have-wcag/dist/widget.js"></script>
<script>
  HaveWcagWidget.init({ position: "bottom-right" });
</script>

Development (Widget + Auditor)

import { widget, auditor } from "have-wcag";

// Widget for all environments
widget.init({ position: "bottom-right" });

// Auditor only in development
if (process.env.NODE_ENV === "development") {
  auditor.init({ position: "bottom-left", level: "AA" });
}

Auto-Initialization (Script Tag)

<script>
  window.HAVE_WCAG_CONFIG = {
    widget: {
      enabled: true,
      position: "bottom-right",
    },
    auditor: {
      enabled: false, // Set to true in development
      position: "bottom-left",
    },
  };
</script>
<script src="https://unpkg.com/have-wcag/dist/bundle.js"></script>

Configuration

Widget Options

interface WidgetConfig {
  position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
  features?: Array<
    | "textSize"
    | "contrast"
    | "darkMode"
    | "dyslexiaFont"
    | "lineHeight"
    | "linkHighlight"
    | "cursorSize"
    | "readingGuide"
  >;
  theme?: {
    primaryColor?: string;
    backgroundColor?: string;
    textColor?: string;
    accentColor?: string;
    borderRadius?: string;
  };
  buttonLabel?: string;
  panelTitle?: string;
}

Auditor Options

interface AuditorConfig {
  showToolbar?: boolean;
  autoRun?: boolean;
  level?: "A" | "AA" | "AAA";
  checks?: Array<"contrast" | "textResize" | "keyboard">;
  onComplete?: (results: AuditResults) => void;
}

API

Widget

import { widget } from "have-wcag";

widget.init(config); // Initialize widget
widget.destroy(); // Remove widget
widget.open(); // Open panel programmatically
widget.close(); // Close panel
widget.reset(); // Reset all settings
widget.configure(opts); // Update configuration

Auditor

import { auditor } from "have-wcag";

auditor.init(config); // Initialize auditor
auditor.destroy(); // Remove auditor
auditor.audit(); // Run audit
auditor.auditElement(el); // Audit specific element
auditor.configure(opts); // Update configuration

Build Outputs

| File | Description | | --------------------- | ---------------------------- | | dist/index.js | CommonJS (widget + auditor) | | dist/index.esm.js | ES Module (widget + auditor) | | dist/widget.js | Widget only (IIFE) | | dist/widget.esm.js | Widget only (ESM) | | dist/auditor.js | Auditor only (IIFE) | | dist/auditor.esm.js | Auditor only (ESM) | | dist/bundle.js | Auto-initializing bundle |

Framework Examples

React

import { useEffect } from "react";
import { widget, auditor } from "have-wcag";

function App() {
  useEffect(() => {
    widget.init({ position: "bottom-right" });

    if (process.env.NODE_ENV === "development") {
      auditor.init({ position: "bottom-left" });
    }

    return () => {
      widget.destroy();
      auditor.destroy();
    };
  }, []);

  return <div>Your app content</div>;
}

Vue

<script setup>
import { onMounted, onUnmounted } from "vue";
import { widget, auditor } from "have-wcag";

onMounted(() => {
  widget.init({ position: "bottom-right" });

  if (import.meta.env.DEV) {
    auditor.init({ position: "bottom-left" });
  }
});

onUnmounted(() => {
  widget.destroy();
  auditor.destroy();
});
</script>

Next.js

"use client";
import { useEffect } from "react";
import { widget, auditor } from "have-wcag";

export default function A11yProvider({ children }) {
  useEffect(() => {
    widget.init({ position: "bottom-right" });

    if (process.env.NODE_ENV === "development") {
      auditor.init({ position: "bottom-left" });
    }

    return () => {
      widget.destroy();
      auditor.destroy();
    };
  }, []);

  return children;
}

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Type check
npm run typecheck

# Test
npm test

License

MIT