0.0.1 • Published 3 years ago

rsba-notification v0.0.1

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

rsba-notification

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save rsba-notification

settings

type IziToastPosition = 'bottomRight' | 'bottomLeft' | 'topRight' | 'topLeft' | 'topCenter' | 'bottomCenter' | 'center';
type IziToastTransitionIn = 'bounceInLeft' | 'bounceInRight' | 'bounceInUp' | 'bounceInDown' | 'fadeIn' | 'fadeInDown' | 'fadeInUp' | 'fadeInLeft' | 'fadeInRight' | 'flipInX';
type IziToastTransitionOut = 'fadeOut' | 'fadeOutUp' | 'fadeOutDown' | 'fadeOutLeft' | 'fadeOutRight' | 'flipOutX';
type immediateTypes = 'info' | 'error' | 'warning' | 'success' | 'question';

Usage

import React, {useEffect} from 'react'

import {defaultNotification, useNotification, notification } from 'rsba-notification'

const App = () => {
  const otherShowMessage = useNotification({position: 'topRight', message: 'Hi, how it is going'})

  useEffect(() => {
    notification('info', {
      message: 'Hi, how it is going',
      position: 'topRight'
    })
    defaultNotification("I am a default notification")
  });

  return (
    <div>
      <button onClick={() => otherShowMessage()} >Show</button>
    </div>
  )
};

export default App

License

MIT © Feujo