next-right-click-disable
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Next Right Click Disable

A React component to disable right-click and other interactions on a page. Created and maintained by qrinux.com.

Installation

npm install next-right-click-disable

Usage

import { DisableRightClick } from 'next-right-click-disable';

function YourPage() {
  return (
    <DisableRightClick>
      {/* Your content here */}
      <div className="min-h-screen flex items-center justify-center">
        <h1>Your Protected Content</h1>
        {/* Add your content */}
      </div>
    </DisableRightClick>
  );
}

export default YourPage;

Features

  • Disables right-click context menu
  • Prevents text selection
  • Blocks drag and drop operations
  • Stops copy and paste functionality
  • Works on both client and server side
  • Compatible with Next.js and React

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Opera (latest)
  • Internet Explorer (not supported)

Library Support

  • Next.js 14.0.0+
  • React 18.3.1+
  • TypeScript 5.0.0+

Version

Current version: 1.0.1

Usage Examples

Basic Usage

import { DisableRightClick } from 'next-right-click-disable';

export default function ProtectedPage() {
  return (
    <DisableRightClick>
      <div className="container mx-auto p-4">
        <h1 className="text-2xl font-bold">Protected Content</h1>
        <p>This content is protected from right-click and other interactions.</p>
      </div>
    </DisableRightClick>
  );
}

Using with Next.js Layout

import { DisableRightClick } from 'next-right-click-disable';

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        <DisableRightClick>
          {children}
        </DisableRightClick>
      </body>
    </html>
  );
}

API

Props

Prop Type Description Default
children React.ReactNode Content to be protected -

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

MIT License - Copyright (c) 2025 qrinux.com

Support

For support, please contact us at qrinux.com or open an issue in the GitHub repository.

Changelog

1.0.1

  • Initial release
  • Added comprehensive documentation
  • Added browser support information
  • Added library compatibility details
  • Added usage examples

Package Sidebar

Install

npm i next-right-click-disable

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

47.4 kB

Total Files

25

Last publish

Collaborators

  • qrinux