
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-async-alert-confirm
Advanced tools
A reusable React component library for alert dialog and confirm dialog
React Async Alert Confirm is a plugin for ReactJS project to use alert dialog and confirm dialog in async way. Seperate logic for handling yes or no only ! No any callback needed ! Only React and pure CSS, super light and super fast ! If you don't like call back, and want the good ux and dx component, this is a good thing for you !
npm i react-async-alert-confirm
<!DOCTYPE html>
<html lang="en">
<head>
<title>React Project</title>
</head>
<body>
<div id="root"></div>
<div id="confirm-and-alert"></div>
/* Add this to be your portal root, default Id uses "confirm-and-alert", you
could also rename it */
</body>
</html>
import { app_alert } from "react-async-alert-confirm";
const DemoComp = () => {
const clickToAlert = async () => {
/* All the Parameters are optional, no required */
await app_alert({
title: "Your Alert Title",
content: "I Am an Alert Content",
confirm_text: "Okay",
node_name:
"confirm-and-alert" /* If you changed Id of portal root, remember to specify here */,
});
console.warn("after alert");
/* This will be executed after you click okay btn on Alert Dialog ! */
};
return (
<>
<button onClick={clickToAlert}>Click Me</button>
</>
);
};
import { app_confirm } from "react-async-alert-confirm";
const DemoComp = () => {
const clickToConfirm = async () => {
/* All the Parameters are optional, no required */
const is_confirm = await app_confirm({
title: "Your Confirm Title",
content: "I Am a Confirm Content",
cancel_text: "Cancel",
confirm_text: "Confirm",
node_name:
"confirm-and-alert" /* If you changed Id of portal root, remember to specify here */,
});
console.warn(is_confirm, "after confirm");
/* This will be executed after you click okay btn on Confirm Dialog ! */
/* is_confirm will be true if user click confirm btn, will be false if user click cancel btn */
};
return (
<>
<button onClick={clickToConfirm}>Click Me</button>
</>
);
};
It's welcome to report me any issue or bug, thanks a lot!
FAQs
A reusable React component library for alert dialog and confirm dialog
The npm package react-async-alert-confirm receives a total of 120 weekly downloads. As such, react-async-alert-confirm popularity was classified as not popular.
We found that react-async-alert-confirm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.