kodobe-react-alert
v2.0.4
Published
kodobe react alert
Downloads
1
Readme
Kodobe React Alert
This is a simple react alert package
Install
npm install kodobe-react-alert
or
yarn add kodobe-react-alert
Setup
import Alert from 'kodobe-react-alert';
Usage
import Alert from "kodobe-react-alert";
function App() {
return (
<div>
<h3>Here is how to use a alert</h3>
<br />
<Button
onClick={() =>
Alert.showError({
content: (
<div>
This is life <b>This is it</b>
<a href="https://google.com">Google</a>
</div>
),
})
}
>
Show Error
</Button>
</div>
);
}
Options
- content: Any thing
- timeout: time it takes the alert to go off (number, default: 5s)
Alerts
- success: Alert.showSuccess()
- error: Alert.showError()
- info: Alert.showInfo()
- default: Alert.show()