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

react-native-a11y-highlighter

v0.1.0

Published

DEV-only visual overlay that highlights accessibility issues in React Native apps

Readme

react-native-a11y-highlighter

DEV-only visual overlay that highlights accessibility issues directly in your React Native simulator. No need to open Xcode's Accessibility Inspector or Android's accessibility scanner.

What it does

Drop <A11yDevOverlay /> at the root of your app. In development mode, it draws colored borders around interactive elements:

  • Red — Touch target smaller than 44×44dp (Apple HIG / WCAG 2.5.8)
  • Orange — Missing accessibilityLabel or accessibilityRole
  • Green — All checks pass

In production, it renders nothing. Zero overhead.

Install

npm install react-native-a11y-highlighter
# or
yarn add react-native-a11y-highlighter

No native modules. Works with Expo out of the box.

Quick start

import { A11yDevOverlay, A11yCheck } from 'react-native-a11y-highlighter';

export default function App() {
  return (
    <A11yDevOverlay>
      {/* Wrap elements you want to audit */}
      <A11yCheck interactive name="Submit Button">
        <Pressable
          accessibilityLabel="Submit form"
          accessibilityRole="button"
          onPress={handleSubmit}
        >
          <Text>Submit</Text>
        </Pressable>
      </A11yCheck>
    </A11yDevOverlay>
  );
}

API

<A11yDevOverlay>

Wrap your app root. Activates the overlay in DEV mode.

| Prop | Type | Default | Description | |------|------|---------|-------------| | config | Partial<A11yOverlayConfig> | — | Override default settings | | enabled | boolean | __DEV__ | Force enable/disable |

<A11yDevOverlay
  config={{
    showPassingElements: true,    // Show green borders too
    minTouchTargetSize: 48,       // Use 48dp instead of 44dp
    showSummaryPanel: true,       // Floating badge with issue count
    borderWidth: 3,               // Thicker borders
    colors: {
      error: '#FF0000',
      warning: '#FFA500',
      pass: '#00FF00',
    },
  }}
>
  <App />
</A11yDevOverlay>

<A11yCheck>

Wrap any element to register it for auditing.

| Prop | Type | Default | Description | |------|------|---------|-------------| | interactive | boolean | auto-detected | Mark as interactive element | | name | string | — | Display name in issue details |

<A11yCheck interactive name="Close Button">
  <TouchableOpacity onPress={onClose} accessibilityLabel="Close" accessibilityRole="button">
    <Icon name="close" />
  </TouchableOpacity>
</A11yCheck>

When used outside of <A11yDevOverlay> (or in production), <A11yCheck> is a transparent passthrough — it returns children directly with no wrapper View.

useA11yRegister hook

For cases where wrapping with <A11yCheck> isn't convenient:

import { useA11yRegister } from 'react-native-a11y-highlighter';

function MyButton({ label }: { label: string }) {
  const { ref, onLayout } = useA11yRegister({
    a11yProps: { accessibilityLabel: label, accessibilityRole: 'button' },
    isInteractive: true,
    displayName: 'MyButton',
  });

  return (
    <Pressable
      ref={ref}
      onLayout={onLayout}
      accessibilityLabel={label}
      accessibilityRole="button"
      collapsable={false}
    >
      <Text>{label}</Text>
    </Pressable>
  );
}

Checks

| Check | Severity | Condition | |-------|----------|-----------| | Touch target size | Error (red) | Width or height < 44dp on interactive elements | | Accessibility label | Warning (orange) | Missing accessibilityLabel / aria-label on interactive elements | | Accessibility role | Warning (orange) | Missing accessibilityRole on interactive elements |

Summary panel

A floating badge appears in the top-right corner showing the issue count. Tap it to open a detail modal listing every issue with its element name and description.

How it works

  1. <A11yDevOverlay> creates a React Context (registry)
  2. <A11yCheck> wrappers register elements via the context
  3. onLayout + measureInWindow() provides absolute screen coordinates
  4. The provider runs all checks against each element
  5. OverlayRenderer reads from context and draws absolute-positioned colored borders
  6. In production (__DEV__ === false): the overlay renders <>{children}</> — no context, no state, no measurement

Compatibility

  • React Native ≥ 0.70
  • React ≥ 17
  • Expo compatible
  • Works on both Paper and Fabric architectures
  • Pure JavaScript — no native modules

License

MIT