Yoyo Popup

Dependency Free Customizable Light Weight Elegant Easy to Use
Example
Success Popup

showYoyoPopup({

text: 'Created Successfully',

type: 'success',

timeOut: 5000,

});

Installation
- Install via npm
Install Package

npm install yoyo-popup

- Install via yarn
Install Package

yarn add yoyo-popup

- Import (npm / yarn)
Import ES6 Module

import { showYoyoPopup } from './node_modules/yoyo-popup/dist/yoyoPopup.min.mjs';

Include

<script src="./node_modules/yoyo-popup/dist/yoyoPopup.umd.min.js"></script>

- Include via CDN
CDN

<!-- jsDelivr CDN -->

<script src="https://cdn.jsdelivr.net/gh/smallvi/yoyoPopup@latest/dist/yoyoPopup.umd.min.js"></script>


<!-- unpkg CDN -->

<script src="https://unpkg.com/yoyo-popup@latest/dist/yoyoPopup.umd.min.js"></script>

- Self Hosted
Import ES6 Module

import { showYoyoPopup } from 'path/to/yoyoPopup.min.mjs';

Include

<script src="path/to/yoyoPopup.umd.min.js"></script>

Usage
Call the `yoyoPopup` function after the page has loaded.
Simple Yoyo Popup

showYoyoPopup({

text: 'Done',

type: 'success',

});

Advance Yoyo Popup

showYoyoPopup({

text: 'Are you sure you want to proceed?',

subtext: 'This action cannot be undone.',

type: 'danger',

isStatic: true,

hasConfirmation: true,

hasCancellation: true,

confirmLabel: 'Yes, proceed',

cancelLabel: 'Cancel',

closeLabel: 'Close',

timeOut: 5000,

confirmFunction: ()=> functionConfirm(),

cancelFunction: ()=> functionCancel(),

closeFunction: () => alert('You click Close'),

});

Params
Description

text

Mandatory

Main text displayed in the popup

subtext

Optional

Additional text shown below the main text.

type

Optional

Icon type.

('info', 'question', 'success', 'warning', 'danger')

title

Optional

Title of the popup.

isStatic

Optional

Boolean indicating if the popup is static.

(true, false)

hasConfirmation

Optional

Boolean indicating if the popup includes a confirm button.

(true, false)

hasCancellation

Optional

Boolean indicating if the popup includes a cancel button.

(true, false)

confirmLabel

Optional

Text label for the confirm button.

cancelLabel

Optional

Text label for the cancel button.

closeLabel

Optional

Text label for the close button.

formId

Optional

ID of the form to submit.

confirmFunction

Optional

Function to call when the confirm button is pressed.

cancelFunction

Optional

Function to call when the cancel button is pressed.

closeFunction

Optional

Function to call when the close button is pressed.

timeOut

Optional

Auto-close the popup after a specified time.

(e.g., `1000` for 1 second)