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-is-keyboard-connected

v1.1.0

Published

React Native library for checking whether a keyboard is connected

Readme

react-native-is-keyboard-connected

React Native Is Keyboard Connected

Native-first React Native module that reports whether a physical (hardware) keyboard is connected, and emits an event whenever that connection state changes — on iOS and Android.

  • 🔌 Connection status — one-shot isKeyboardConnected() query
  • 📡 Live updates — subscribe to connect / disconnect events
  • ⚛️ HookuseIsKeyboardConnected() for drop-in React state
  • ⚡ New Architecture · Old Architecture · Bridgeless

[!TIP] Need more than connection status? This module is also bundled — alongside screen-reader focus order, physical-keyboard support, and iOS accessibility containers — into the all-in-one react-native-a11y toolkit. Install the focused package for just this capability, or react-native-a11y for the complete set.

Installation

yarn add react-native-is-keyboard-connected
cd ios && pod install

That's it — on iOS the GameController framework is linked automatically via the podspec. No manual "Link Binary With Libraries" step is required.

GameController is the only App Store–safe way to obtain hardware keyboard connection status (GCKeyboard, iOS 14+). Other approaches are workarounds that risk rejection during App Store review.

Usage

Hardware keyboard

Backed by the native module (GameController on iOS, Configuration on Android).

import {
  isKeyboardConnected,
  keyboardStatusListener,
  useIsKeyboardConnected,
  useIsKeyboardConnectedRef,
} from 'react-native-is-keyboard-connected';

// Hook — re-renders when a keyboard connects or disconnects
const connected = useIsKeyboardConnected();

// Ref hook — same live value without re-rendering (read `ref.current` in callbacks)
const connectedRef = useIsKeyboardConnectedRef();

// Or drive it yourself:
// one-shot query
isKeyboardConnected().then((isConnected) => setResult(isConnected));

// subscribe to changes — returns an unsubscribe function
const removeListener = keyboardStatusListener((e) => setResult(e.status));

Screen reader

Note: These helpers only wrap React Native's default AccessibilityInfo API — no native module and no extra linking. They're syntax sugar that mirrors the keyboard API (same { status } listener payload) so both can be used the same way.

import {
  isScreenReaderEnabled,
  screenReaderStatusListener,
  useIsScreenReaderEnabled,
  useIsScreenReaderEnabledRef,
} from 'react-native-is-keyboard-connected';

// Hook — re-renders when VoiceOver / TalkBack is toggled
const enabled = useIsScreenReaderEnabled();

// Ref hook — same live value without re-rendering
const enabledRef = useIsScreenReaderEnabledRef();

// Or drive it yourself:
isScreenReaderEnabled().then((isEnabled) => setResult(isEnabled));

const removeListener = screenReaderStatusListener((e) => setResult(e.status));

API

Hardware keyboard (native module)

| Export | Purpose | | :-- | :-- | | useIsKeyboardConnected() | Hook returning the current connection state, updated on change. | | useIsKeyboardConnectedRef() | Ref variant — .current holds the latest state without re-rendering. | | isKeyboardConnected() | Promise<boolean> — one-shot query of the current state. | | keyboardStatusListener(cb) | Subscribe to { status: boolean } change events; returns an unsubscribe function. |

Screen reader (wraps RN AccessibilityInfo)

| Export | Purpose | | :-- | :-- | | useIsScreenReaderEnabled() | Hook returning whether a screen reader is enabled, updated on change. | | useIsScreenReaderEnabledRef() | Ref variant — .current holds the latest state without re-rendering. | | isScreenReaderEnabled() | Promise<boolean> — one-shot query of the current state. | | screenReaderStatusListener(cb) | Subscribe to { status: boolean } change events; returns an unsubscribe function. |

Architecture support

| Capability | Supported | | :-- | :-- | | New Architecture (Fabric / Turbo Modules) | ✅ | | Old Architecture (Bridge) | ✅ | | Bridgeless mode | ✅ |

Migrating from 1.0.0

1.1.0 is backward compatible — no breaking changes. isKeyboardConnected, keyboardStatusListener, and useIsKeyboardConnected keep the same signatures, so existing code needs no changes.

New in 1.1.0 (all additive):

  • useIsKeyboardConnectedRef — ref variant of useIsKeyboardConnected.
  • isScreenReaderEnabled / screenReaderStatusListener / useIsScreenReaderEnabled / useIsScreenReaderEnabledRef — screen-reader helpers over RN's AccessibilityInfo (see the note above).

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library