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-pinned-mode

v1.0.0

Published

react-native-pinned-mode is a React Native library that enables developers to easily configure and control Android’s Pinned Mode. With this package, you can lock your app to the foreground and prevent users from leaving the app unintentionally — making it

Readme

react-native-pinned-mode

A lightweight React Native library that enables developers to easily configure and control Android’s Pinned Mode.

With this package, you can:

  • Lock your app to the foreground.

  • Prevent users from leaving the app unintentionally.

  • Ensure uninterrupted focus on a single app — ideal for kiosk-style flows, presentations, or restricted-use scenarios.

⚠️ Note: This package is Android only.


📖 What is Pinned Mode?

Pinned Mode (introduced in Android 5.0 Lollipop) allows you to lock your app to the foreground so users cannot switch to another app accidentally.

  • Unlike Kiosk Mode, Pinned Mode does not require device owner privileges or enterprise management tools.

  • Users can exit Pinned Mode with a specific key combination (usually Back + Overview/Recent Apps buttons).

  • This makes it lightweight and suitable for temporary focus locking, such as:

  • Payment terminals

  • Customer feedback apps

  • Single-task flows (like exams or demos)

Pinned Mode ensures the app stays in focus while still giving users a way to exit if needed — making it less restrictive than full Kiosk Mode.


📦 Installation

npm install react-native-pinned-mode

⚡ Usage

import {
  enablePinnedMode,
  disablePinnedMode,
  isPinnedModeActive,
} from 'react-native-pinned-mode';

const handlePinnedMode = async () => {
  try {
    const active = await isPinnedModeActive();
    if (!active) {
      await enablePinnedMode();   // Enable pinned mode
    } else {
      await disablePinnedMode();  // Disable pinned mode
    }
  } catch (e) {
    console.log("Pinned Mode Error:", e);
  }
};

🚀 Publishing to Play Store

When using Pinned Mode, apps are generally allowed on the Play Store because:

  • It is an official Android API.

  • Users always have a system-level way to exit.

✅ Best practices for publishing:

  • Clearly explain the use case in your app description if Pinned Mode is a core feature.

  • Avoid presenting it as "locking users" permanently — emphasize focus and security.

  • Ensure your app behaves gracefully when Pinned Mode is exited.


🍎 iOS Guidance

Pinned Mode is an Android-only feature. iOS does not provide an equivalent API in React Native.

However, iOS has:

  • Guided Access → A system-level feature that lets users lock the device to a single app. This is controlled by the device owner (via accessibility settings), not by the app.

  • MDM (Mobile Device Management) / Single App Mode → Enterprise-level solution to lock devices into a single app.

👉 Developers cannot enable Guided Access or Single App Mode programmatically from within an iOS app. For apps requiring similar restrictions on iOS, you’ll need to instruct users/admins to enable Guided Access or use MDM solutions.


📌 Example Use Cases

  • Customer feedback apps in stores.

  • Payment terminals where accidental exits should be avoided.

  • Exam/test apps to prevent switching apps.

  • Single-purpose enterprise apps.


Contributing

License

MIT