@developermafia/simple-alert-react
v1.0.0
Published
```bash npm i @developermafia/simple-alert-react ```
Downloads
30
Maintainers
Readme
simple-alert-react
npm i @developermafia/simple-alert-react
Uso
import { useSimpleAlertReact } from '@developermafia/simple-alert-react';
export function App() {
const { openAlert } = useSimpleAlertReact();
const createSimpleAlert = async () => {
const dialog = await openAlert({ content: 'Simple Alert' });
// console.log(dialog); get response user click
if (dialog === 'true') {
// Actions
}
};
return (
<div>
<button onClick={createSimpleAlert}>Click alert!</button>
</div>
);
}
export default App;
Opciones de alerta
| PROP | TYPE | | --------------- | --------------------- | | acceptButton | boolean | | cancelButton | boolean | | content | string or JSX.Element | | closeButton | boolean | | opacityBackdrop | string (0.1 - 1) | | colorBackdrop | string (Hexadecimal) | | reverseButtons | boolean | | textAccept | string | | textCancel | string | | closeOnEsc | boolean |