1.0.5 • Published 3 years ago

basit-toast v1.0.5

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

BASIT TOAST 🔔🔔

a basit (simple) toast like notification 🔔🔔.

Daftar Isi 📚

Instalasi

yarn add basit-toast
npm install basit-toast

BasitToastComponents

import React, { useState } from 'react'
import { BasitToast } from 'basit-toast'
import 'basit-toast/dist/basit-toast.css'

const ExampleBasitToast = () => {
  const [openToast, setOpenToast] = useState(false)

  const handleClick = () => {
    setOpenToast(true)
  }

  return (
    <>
      <BasitToast
        isOpen={openToast}
        handleClose={() => setOpenToast(false)}
        position='bottomcenter'
        severity='errors'
        handleCloseDuration={3000}
        message='Your errors toast here !'
      />
      <button onClick={handleClick}>Click</button>
    </>
  )
}

export default ExampleBasitToast

useBasitToast

import React from 'react'
import { useBasitToast } from 'basit-toast'
import 'basit-toast/dist/basit-toast.css'

const ExampleUseBasitToast = () => {
  const { defaults } = useBasitToast()

  const handleClick = () => {
    defaults('Hallo', 'bottomcenter')
  }

  return <button onClick={handleClick}>click</button>
}

export default ExampleUseBasitToast

basittoast

import React from 'react'
import { basittoast } from 'basit-toast'
import 'basit-toast/dist/basit-toast.css'

const ExampleBasitToast = () => {
  const handleClick = () => {
    basittoast.info('HELLO', 'bottomcenter', 3000)
  }

  return <button onClick={handleClick}>click</button>
}

export default ExampleBasitToast

Props

How to Contribute ?

  1. clone this repository
  2. install dependencies
yarn
  1. checkout to new branch
git checkout -B new-feature
  1. modify and push in your branch
  2. add pull request and done.

Licence

MIT.

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago