
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
react-ramin-modal
Advanced tools
A lightweight and flexible modal system for React that supports stacked modal content and dynamic rendering. Easily open modals with any content — React components, HTML elements, or plain text — and manage multiple layers using a content stack.
A lightweight and flexible modal system for React that supports stacked modal content and dynamic rendering. Easily open modals with any content — React components, HTML elements, or plain text — and manage multiple layers using a content stack.
npm install react-ramin-modal
# or
yarn add react-ramin-modal
```jsx
import React from "react";
import {
ModalProvider,
GeneralModal,
} from "react-ramin-modal";
function App() {
# destruct the openModal and closeModal from useModal hook
const { openModal,closeModal}=useModal();
const handleOpen = () => {
openModal(<div>This is a modal!</div>);
};
return (
<ModalProvider>
<button onClick={handleOpen}>Open Modal</button>
<GeneralModal />
</ModalProvider>
);
}
export default App;
🧠 How It Works
ModalProvider: Wraps your app to enable modal state management.
GeneralModal: Renders modal content based on what's in the stack.
openModal(content): Opens a modal with the given content:
React component
JSX/HTML element
String
closeModal(): Closes the most recent modal content (last in the stack).
contentStack: An array of modal content currently in the stack.
open: Boolean flag indicating if the modal is currently visible.
openModal(<div>First Modal</div>);
openModal(<div>Second Modal</div>);
openModal(<div>Third Modal</div>);
// Then closeModal() will remove them one by one (LIFO order)
| Item | Type | Description |
| --------------- | --------- | ------------------------------- |
| `ModalProvider` | Component | Wraps the app, provides context |
| `GeneralModal` | Component | Renders modal content
and you can use this for controlling your modal:
const {openModal, closeModal, open, contentStack}=useModal();
| `openModal()` | Function | Opens modal with given content |
| `closeModal()` | Function | Closes the most recent modal |
| `open` | boolean | Whether the modal is open |
| `contentStack` | array | The stack of modal contents |
```jsx
const MyModalContent = () => (
<div>
<h2>Hello!</h2>
<button onClick={closeModal}>Close</button>
</div>
);
// Somewhere in your app:
openModal(<MyModalContent />);
FAQs
A lightweight and flexible modal system for React that supports stacked modal content and dynamic rendering. Easily open modals with any content — React components, HTML elements, or plain text — and manage multiple layers using a content stack.
The npm package react-ramin-modal receives a total of 0 weekly downloads. As such, react-ramin-modal popularity was classified as not popular.
We found that react-ramin-modal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.