1.0.0 • Published 9 months ago

@smooks/use-notify v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@smooks/use-notify

React Hook for using web browser notifications in your application.

Installation

yarn

yarn add @smooks/use-notify

npm

npm i @smooks/use-notify

Usage

    import useNotification from '@smooks/use-notify';

    const App = () => {
        const trigerNotification = useNotification("Can I steal your kimchi?", {
            body: "I love kimchi, don't you?"
        });
        return (
            <div className="App">
                <button onClick={trigerNotification}>Hello</button>
            </div>
        );
    };

Arguments

ArgumentTypeDescriptionRequired
titlestringThis is a string that represents the title or heading of the notification.yes
optionsobjectNotification options are configuration settings that customize the appearance and behavior of a notification, such as its body, icon, and sound.no

It only works when you *turn on the notification in Settings!*

Information about setting notification ⬇️

Window: Start > Settings > System > Notification

macOS: System Preferences > Notifications > select chrome > change notification settings

If you need some help, please write email to me: 0724ksm@naver.com

1.0.0

9 months ago