Package Exports
- @acrool/react-hotkey
Readme
Acrool React Hotkey
This is a toast message function for React development notifications
Features
- Supports queue hotkey list
- Plug and unplug using
@acrool/react-portalandframer-motion
Install
yarn add @acrool/react-hotkeyUsage
add in your index.tsx
import "@acrool/react-hotkey/dist/index.css";add in your App.tsx
import {HotkeyPortal} from "@acrool/react-hotkey";
const App = () => {
return (
<div>
<BaseUsed/>
<HotkeyPortal
isVisibleQueueKey={false}
renderLoader={<Loader/>}
defaultMessage="Loading..."
/>
</div>
);
};then in your page
import {hotkey} from '@acrool/react-hotkey';
import {useEffect} from "react";
const Example = () => {
useEffect(() => {
hotkey.show();
setTimeout(() => {
hotkey.hide();
}, 3000)
}, []);
return (
<div>
sample page
</div>
);
};- hotkey.show
- hotkey.hide
- toast.hideAll
There is also a example that you can play with it: