Toast Notification based on Bootstrap Design.
npm install react-toast-notification'react-toast-notification' allows you to put notification easily on your web apps.
npm install react-toast-notification
import React, { Component } from 'react';
import { toast } from 'react-toast-notification';
export default class App extends Component {
render() {
return (
{
toast('Created successfully!', {
status: 'Thanks!',
type: 'success',
autoHide: false,
delay: '7000'
})
}
)
}
}
import React, { Component } from 'react';
import toast from 'react-toast-notification';
export default class App extends Component {
render() {
return (
{toast.success('Created successfully')}
)
}
}
You can directly call 'success', 'error', 'warn' or 'info' function too. For example,
import React, { Component } from 'react';
import { success } from 'react-toast-notification';
export default class App extends Component {
render() {
return (
{success('Created successfully')}
)
}
}
import React, { Component } from 'react';
import toast from 'react-toast-notification';
export default class App extends Component {
render() {
return (
{toast.error('Something went wrong.')}
)
}
}
import React, { Component } from 'react';
import toast from 'react-toast-notification';
export default class App extends Component {
render() {
return (
{toast.warn('Note, this is deprecated.')}
)
}
}
import React, { Component } from 'react';
import toast from 'react-toast-notification';
export default class App extends Component {
render() {
return (
{toast.info('Your system is upto date.')}
)
}
}
status : 'Success!' type : 'success' delay : '7000' autoHide : 'true' Any suggestions or pull requests are welcomed!
Licensed under MIT