JSPM

  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q60605F
  • License MIT

Hotkey library based for Reactjs

Package Exports

  • @acrool/react-hotkey

Readme

Acrool React Hotkey

Acrool React Hotkey Logo

This is a toast message function for React development notifications

NPM npm npm

npm downloads npm

Features

  • Supports queue hotkey list
  • Plug and unplug using @acrool/react-portal and framer-motion

Install

yarn add @acrool/react-hotkey

Usage

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:

Play react-editext-example

License

MIT © Acrool & Imagine