https://github.com/acrool/acrool-react-toaster
This is a toast message function for React development notifications
https://github.com/acrool/acrool-react-toaster
react react-toaster toaster
Last synced: about 1 month ago
JSON representation
This is a toast message function for React development notifications
- Host: GitHub
- URL: https://github.com/acrool/acrool-react-toaster
- Owner: acrool
- License: mit
- Created: 2022-02-20T10:09:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T16:07:39.000Z (7 months ago)
- Last Synced: 2024-10-19T22:21:07.937Z (7 months ago)
- Topics: react, react-toaster, toaster
- Language: TypeScript
- Homepage: https://acrool-react-toaster.pages.dev/
- Size: 4.46 MB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-react - Acrool React Toaster - Toaster (React underlying structure)
- awesome-react - Acrool React Toaster - Toaster (React underlying structure)
README
# Acrool React Toaster
This is a toast message function for React development notifications[](https://www.npmjs.com/package/@acrool/react-toaster)
[](https://github.com/acrool/@acrool/react-toaster/blob/main/LICENSE)
[](https://github.com/acrool/react-toaster/blob/main/LICENSE)[](https://www.npmjs.com/package/@acrool/react-toaster)
[](https://www.npmjs.com/package/@acrool/react-toaster)## Features
- Supports 5 status colors: default, success, info, warning, danger
- Support show limit
- Support show position: top, bottom, left, center, right
- Call via global method
- Configurable disappearance delay seconds
- Plug and unplug using `@acrool/react-portal` and `framer-motion`## Install
```bash
yarn add framer-motion @acrool/react-toaster
```in your packages. (Make the version of styled-component you use match the version of styled-component used in acrool-react-gird)
```json
"resolutions": {
"framer-motion": "^11.x"
}
```## Usage
add in your index.tsx
```tst
import "@acrool/react-toaster/dist/index.css";
```add in your App.tsx
```tsx
import {ToasterPortal, themeMap} from "@acrool/react-toaster";
import CustomCheckIcon from '../../../assets/custom_check.svg?react';const App = () => {
return (
);
};
```then in your page
```tsx
import {toast} from '@acrool/react-toaster';const Example = () => {
return (
toast({message: 'useToaster message'})}>
useToaster message
);
};
```- toast
- toast.success
- toast.info
- toast.warning
- toast.dangerThere is also a example that you can play with it:
[](https://acrool-react-toaster.pages.dev)
## License
MIT © [Acrool](https://github.com/acrool) & [Imagine](https://github.com/imagine10255)