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-mobile-warning

v1.0.7

Published

A React component that displays a warning modal when accessed from mobile devices

Readme

react-mobile-warning

English | 한국어

npm version npm downloads license

A React component that displays a warning modal when accessed from mobile devices or small screens.

Installation

npm install react-mobile-warning

or

yarn add react-mobile-warning

or

pnpm add react-mobile-warning

Usage

Basic Usage

import MobileWarning from 'react-mobile-warning';

function App() {
  return (
    <>
      <MobileWarning />
      {/* Your app content */}
    </>
  );
}

Using Named Export

import { MobileWarning } from 'react-mobile-warning';

function App() {
  return (
    <>
      <MobileWarning />
      {/* Your app content */}
    </>
  );
}

Custom Configuration

import MobileWarning from 'react-mobile-warning';

function App() {
  return (
    <>
      <MobileWarning
        minWidth={1200}
        minHeight={800}
        title="Desktop Only"
        message="This application requires a desktop computer."
        tip="Please use a desktop browser for the best experience."
      />
      {/* Your app content */}
    </>
  );
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | language | 'en' \| 'ko' \| 'ja' \| 'zh' \| 'es' \| 'fr' \| 'de' \| null | auto-detected | Language code for translations. If not provided, automatically detects from browser language. Set to null to use English. | | minWidth | number | 1024 | Minimum screen width in pixels. Screens smaller than this will be considered mobile. | | minHeight | number | 600 | Minimum screen height in pixels. Screens smaller than this will be considered mobile. | | title | string | - | Modal title text (overrides language setting). | | message | string | - | Main message text (overrides language setting). Supports newlines with \n. | | tip | string | - | Tip message text (overrides language setting). Supports newlines with \n. | | className | string | - | Custom class name for the root element. | | overlayClassName | string | - | Custom class name for the overlay background. | | modalClassName | string | - | Custom class name for the modal container. |

Supported Languages

  • en - English (default)
  • ko - Korean
  • ja - Japanese
  • zh - Chinese
  • es - Spanish
  • fr - French
  • de - German

Examples

Auto-detect Browser Language (Default)

import MobileWarning from 'react-mobile-warning';

function App() {
  return (
    <>
      <MobileWarning />
      {/* Automatically uses browser language */}
    </>
  );
}

Using Language Code

import MobileWarning from 'react-mobile-warning';

function App() {
  return (
    <>
      <MobileWarning language="ko" />
      {/* Force Korean version */}
    </>
  );
}

Disable Auto-detection

import MobileWarning from 'react-mobile-warning';

function App() {
  return (
    <>
      <MobileWarning language={null} />
      {/* Always uses English */}
    </>
  );
}

Custom Messages

import MobileWarning from 'react-mobile-warning';

function App() {
  return (
    <>
      <MobileWarning
        language="en"
        title="Desktop Only"
        message="This application requires a desktop computer."
        tip="Please use a desktop browser."
      />
    </>
  );
}

Requirements

  • React 16.8.0 or higher
  • React DOM 16.8.0 or higher
  • Tailwind CSS (for styling) - Optional if using custom styles

Styling

This component uses Tailwind CSS classes. Make sure your project has Tailwind CSS configured.

If you're not using Tailwind CSS, you can override the styles using the className, overlayClassName, and modalClassName props.

Without Tailwind CSS

If you don't use Tailwind CSS, you can provide your own styles:

import MobileWarning from 'react-mobile-warning';
import './custom-styles.css';

function App() {
  return (
    <MobileWarning
      className="custom-overlay"
      overlayClassName="custom-overlay-bg"
      modalClassName="custom-modal"
    />
  );
}

License

MIT

Author

Glacier Han