3.2.3 • Published 6 months ago
@acrool/react-toaster v3.2.3
Acrool React Toaster
^3.2.0 support react >=18.0.0 <20.0.0
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-portalandframer-motion
Install
yarn add @acrool/react-toasterUsage
add in your index.tsx
import "@acrool/react-toaster/dist/index.css";add in your App.tsx
import {ToasterPortal, themeMap} from "@acrool/react-toaster";
import CustomCheckIcon from '../../../assets/custom_check.svg?react';
const App = () => {
return (
<div>
<BaseUsed/>
<ToasterPortal
defaultTimeout={3000}
limit={6}
position={{
vertical: 'top',
horizontal: 'center',
}}
themeMap={{
...themeMap,
success: {
...themeMap.success,
icon: CustomCheckIcon,
}
}}
/>
</div>
);
};then in your page
import {toast} from '@acrool/react-toaster';
const Example = () => {
return (
<div>
<button type="button" onClick={() => toast({message: 'useToaster message'})}>
useToaster message
</button>
</div>
);
};- toast
- toast.success
- toast.info
- toast.warning
- toast.danger
There is also a example that you can play with it:
License
3.1.11
8 months ago
3.2.1-alpha.0
6 months ago
3.2.2
6 months ago
3.1.11-alpha.2
11 months ago
3.2.1
6 months ago
3.1.11-alpha.1
11 months ago
3.2.0
6 months ago
3.1.11-alpha.4
9 months ago
3.1.11-alpha.3
11 months ago
3.1.11-alpha.0
11 months ago
3.2.3
6 months ago
3.1.11-alpha.5
8 months ago
3.1.10
12 months ago
3.1.10-alpha.0
1 year ago
3.1.9
1 year ago
3.1.7-alpha.3
1 year ago
3.1.3
1 year ago
3.1.7-alpha.2
1 year ago
3.1.2
1 year ago
3.1.8-alpha.0
1 year ago
3.1.7
1 year ago
3.1.8-alpha.1
1 year ago
3.1.6
1 year ago
3.1.7-alpha.1
1 year ago
3.1.5
1 year ago
3.1.7-alpha.0
1 year ago
3.1.4
1 year ago
3.1.6-alpha.1
1 year ago
3.1.6-alpha.2
1 year ago
3.1.6-alpha.0
1 year ago
3.1.6-alpha.3
1 year ago
3.1.5-alpha.0
1 year ago
3.1.6-alpha.4
1 year ago
3.1.9-alpha.0
1 year ago
3.1.9-alpha.2
1 year ago
3.1.8
1 year ago
3.1.2-alpha.2
1 year ago