
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
react-overlay-component
Advanced tools
renders an overlay/modal.
npm install --save react-overlay-component
import React, { useState } from "react";
import Overlay from "react-overlay-component";
function App() {
const [isOpen, setOverlay] = useState(false);
const closeOverlay = () => setOverlay(false);
const configs = {
animate: true,
// top: `5em`,
// clickDismiss: false,
// escapeDismiss: false,
// focusOutline: false,
};
return (
<div>
<button
className="primary"
onClick={() => {
setOverlay(true);
}}
>
open modal
</button>
<Overlay configs={configs} isOpen={isOpen} closeOverlay={closeOverlay}>
<h2>Sample header</h2>
<p>text content</p>
<button
className="danger"
onClick={() => {
setOverlay(false);
}}
>
close modal
</button>
</Overlay>
</div>
);
}
View demos: https://binodswain.github.io/react-overlay-component/
or
git clone git@github.com:binodswain/react-overlay-component.git
cd react-overlay-component
# build the package
npm install
npm build
# run example
cd example
npm install
npm start
react-overlay-component requires isOpen
, configs
(optional), closeOverlay
(optional) as props.
prop | type | optional | description |
---|---|---|---|
isOpen | boolean | false | flag to toggle the overlay |
configs | object | true | config object to customize overlay behavior |
closeOverlay | function | true | function that sets isOpen to false |
const configs = {
animate: true,
top: `5em`,
clickDismiss: false,
escapeDismiss: false,
focusOutline: true,
contentClass: "container overlay-content",
};
key | type | optional | default val | description |
---|---|---|---|---|
animate | boolean | true | true | toggles overlay animation |
top | string | true | 0 | top value for overlay |
clickDismiss | boolean | true | true | enables to close the overlay on clicking backdrop |
escapeDismiss | boolean | true | true | enables to close the overlay on pressing ESC key |
focusOutline | boolean | true | false | addes an outline around the overlay-content div |
contentClass | string | true | '' | additional class to add in overlay-content div |
MIT © binodswain
FAQs
npm package to render overlay/modal with backdrop
The npm package react-overlay-component receives a total of 128 weekly downloads. As such, react-overlay-component popularity was classified as not popular.
We found that react-overlay-component demonstrated a not healthy version release cadence and project activity because the last version was released 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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.