![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
react-simple-dialogs
Advanced tools
Beautiful dialogs with a simple usage. No unnecessary settings, native-like usage, simple.
You can make it work in less than 10 seconds!
# npm
npm install react-simple-dialogs
# yarn
yarn add react-simple-dialogs
# pnpm
pnpm add react-simple-dialogs
In order to correctly render the dialogs, you must place the SimpleDialogContainer
near to your root component.
import React from 'react'
import { SimpleDialogContainer, simpleAlert } from 'react-simple-dialogs'
function App() {
const alert = () => simpleAlert('Easy peasy lemon squeezy!')
return (
<div>
<button onClick={alert}>Alert!</button>
<SimpleDialogContainer />
</div>
)
}
Use the dialogs is almost like use the dialogs native function (alert
, confirm
and prompt
).
All dialog function will return an
Promise
that only resolves when the user interacts with the dialog, so you can wait for the user interaction to continue your code execution.
import { simpleAlert } from 'react-simple-dialogs'
const showAlert = async () => {
await simpleAlert("You can't do this right now.")
console.log('Alert closed')
}
import { simpleConfirm } from 'react-simple-dialogs'
const showConfirmation = async () => {
if (await simpleConfirm('Please confirm something')) {
console.log('Confirmed! 😄')
} else {
console.log('Not confirmed. 🥲')
}
}
import { simplePrompt } from 'react-simple-dialogs'
const showPrompt = async () => {
const name = await simplePrompt('Please inform your name')
console.log(`User name is ${name || 'a mistery'}`)
}
FAQs
A react library to create simple dialogs
The npm package react-simple-dialogs receives a total of 67 weekly downloads. As such, react-simple-dialogs popularity was classified as not popular.
We found that react-simple-dialogs 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.