$ npm i react-alerts-component
This package is used in production by following application:
First you have to wrap your app with the Provider giving it the alert template and optionally some options.
import React, { Component } from 'react'
import { render } from 'react-dom'
import Alert from 'react-alerts-component'
const options = {
margin: '10',
width : "500",
fontColor : 'black',
backgroundColor : 'grey'
}
class App extends Component {
render () {
return (
<Alert />
)
}
}
render(<App />, document.getElementById('root'))
You can pass the following options as props to <Alert />
:
const options = {
type: String,
message: String,
margin: String,
width : String,
fontColor : String,
backgroundColor : String
}
Values that type
can take are as follows:
- default
- danger
- warning
- secondary
- info
- success
- light
- custom