Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gm-alert

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gm-alert

javascript alert ui kit

  • 1.0.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

gm-alert

This lib is a JavaScript tool kit of alert. It's dedicated to lightweight, profiles and highly customizable. It just give a basic style and DOM structure of a modal so that you could do what ever you want easily.

Install

npm install gm-alert
# Or use yarn
yarn add gm-alert

or just use <script> tag:

<link rel="stylesheet" href="path/to/gm-alert.min.css" />
<script src="path/to/gm-alert.min.js"></script>

If you use iife or umd with script tag, you could get global variable GmAlert, all API is on it.

To get dist js and css files, visit releases page or use CDN of jsDelivr.

DOM structure

div.gm-alert-mask > div.modal > div.title + div.body + div.footer > button[data-type="ok"] + button[data-type="cancel"]

API

showAlert(config)

show alert with options:

optiontypedescriptiondefault value
title*title of modal, but if Boolean(title) is false, title will not display''
titleClassNamestringextra class for title element''
body*body of modal''
bodyClassNamestringextra class for body element''
footerClassNamestringextra class for footer element''
okTextstringtext of ok button'ok'
onOKfunctioncallback when you click ok buttonhidAlert
cancelTextstringtext of cancel button'cancel'
onCancelfunctioncallback when you click cancel buttonhidAlert
maskClosAblebooleancall onCancel when click mask of modaltrue

hideAlert()

hide alert

License

MIT

Keywords

FAQs

Package last updated on 12 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc