Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rescriptbr/rescript-toastify
ReasonML bindings for react-toastify
https://github.com/rescriptbr/rescript-toastify
Last synced: 3 months ago
JSON representation
ReasonML bindings for react-toastify
- Host: GitHub
- URL: https://github.com/rescriptbr/rescript-toastify
- Owner: rescriptbr
- License: mit
- Archived: true
- Created: 2020-07-20T20:27:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T17:10:40.000Z (over 3 years ago)
- Last Synced: 2024-05-11T23:34:23.992Z (6 months ago)
- Language: ReScript
- Size: 40 KB
- Stars: 18
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - rescript-toastify - toastify | rescriptbr | 16 | (ReScript)
README
Installation •
Examples •
Documentation
## Installation
First run the below commands to install the dependencies:
```bash
yarn add @reasonbr/bs-toastify -D
yarn add react-toastify
```
Import react-toastify's css somewhere in your code. You can use `[%bs.raw]` if you want to.
```js
import "react-toastify/dist/ReactToastify.css";
```## Examples
```reason
open ReactToastify;[@react.component]
let make = () => {
let handleClick = () => {
let cb = {
Js.log("Cool");
();
};
toast->success(
"Success",
ReactToastify.options(
~autoClose=3000,
~hideProgressBar=false,
~closeOnClick=false,
~onClose=cb,
(),
),
);toast->warning(
"Warning",
ReactToastify.options(
~autoClose=3000,
~position=`topRight,
~hideProgressBar=false,
~closeOnClick=false,
(),
),
);
();
};<>
{"Hello" |> ReasonReact.string}
handleClick()}>
{"Click" |> ReasonReact.string}
>;
};let default = make;
```