1.12.0 • Published 2 years ago

@lidofinance/toast v1.12.0

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

Toast Component

React component for Lido Finance projects based on React-Toastify (https://github.com/fkhadra/react-toastify). Part of Lido UI Components

Install

yarn add @lidofinance/toast

Usage

For example will use ToastDefault, also you can use ToastError, ToastSuccess, ToastInfo and other.

Also, you can use native React-Toastify functional, just import { toast } from '@lidofinance/toast' (see example below), but be careful @lidofinance/toast does not support full functionality of React-Toastify!!!

import { ToastContainer, ToastDefault, toast } from '@lidofinance/toast'

function ExampleToast() {
  const notifyDefault = () => ToastDefault('🚀🚀🚀 Wow so easy!')
  const dismissAll = () => toast.dismiss()

  return (
    <>
      <button onClick={notifyDefault}>Show notify!</button>
      <Button onClick={dismissAll} size='xs' variant='translucent'>
        Dismiss all
      </Button>
      <ToastContainer />
    </>
  )
}

IMPORTANT:

  1. Remember to render the ToastContainer once in your application tree. If you can not figure out where to put it, rendering it in the application root would be the best bet;
  2. @lidofinance/toast use own scss styles, see packages/toast/src/ToastContainer.tsx;

  3. @lidofinance/toast does not support full functionality of React-Toastify!!!

Check out our Storybook at https://ui.lido.fi

1.12.0

2 years ago

1.9.1

2 years ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.11.0

2 years ago

1.10.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

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