A React component to disable right-click and other interactions on a page. Created and maintained by qrinux.com.
npm install next-right-click-disable
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;
- 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
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Opera (latest)
- Internet Explorer (not supported)
- Next.js 14.0.0+
- React 18.3.1+
- TypeScript 5.0.0+
Current version: 1.0.1
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>
);
}
import { DisableRightClick } from 'next-right-click-disable';
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<DisableRightClick>
{children}
</DisableRightClick>
</body>
</html>
);
}
Prop | Type | Description | Default |
---|---|---|---|
children | React.ReactNode | Content to be protected | - |
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
MIT License - Copyright (c) 2025 qrinux.com
For support, please contact us at qrinux.com or open an issue in the GitHub repository.
- Initial release
- Added comprehensive documentation
- Added browser support information
- Added library compatibility details
- Added usage examples