1.0.0 • Published 2 years ago

one-notification v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

A lightweight JavaScript package for Samsung One UI styled notification.

test npm package npm downloads npm bundle size supported node version contributors last commit license

Installation

npm install one-notification

Or in browser you can use One Notification with UNPKG:

<link rel="stylesheet" href="https://unpkg.com/one-notification/dist/one-notification.min.css">
<script src="https://unpkg.com/one-notification"></script>

Usage

import oneNotification from "one-notification";
import "one-notification/dist/one-notification.min.css";

oneNotification({
  /* configuration */
});

Configuration

There are some configuration properties that you can pass into the function parameter:

keytyperequireddefaultdescription
textstringrequiredText that displayed on notification
iconstringrequiredIcon that displayed on notification (You can use text, or HTML tag)
onClickfunctionA function that fired when notification is clicked
iconSizenumber21Icon size in pixels
iconColorstring#FFFFFFIcon color
iconBackgroundSizenumber42Icon background size in pixels
iconBackgroundColorstring#1B9CFCIcon background color
durationstring4sDuration of notification
colorstring#FFFFFFText color
backgroundColorstring#1E272ENotification color
fontSizenumber14Font size in pixels
fontWeightnumber500Font weight
fontFamilystringsans-serifFont family (use it when you are already imported font file in somewhere else)
iconScalenumber0.70Scale down icon when notification is active
borderRadiusnumber1000Notification border radius
zIndexnumber1400Notification z-index

LICENSE

One Notification is released under the MIT license.