Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@flexilla/modal
Advanced tools
A customizable modal component for creating interactive pop-up dialogs in web applications.
To install the @flexilla/modal package, you can use npm:
npm install @flexilla/modal
To use the Modal component, follow these steps:
import { Modal } from '@flexilla/modal';
const options = {
// Specify any desired options here
};
const modal = new Modal('#modalElement', options, '#triggerElement' );
// Show the modal
modal.showModal();
// Hide the modal
modal.hideModal();
// Check if the modal is hidden
const isHidden = modal.isHidden();
| Name | Description | Data Attributes | Type | | --------------- | ----------------------------------------- | --------------- | ------------- | | modalElement | The HTML element representing the modal. | data-modal-id | HTMLElement | | triggerElement| The HTML element that triggers the modal. | data-modal-target | HTMLElement | | options | Optional configuration options for the modal. | - | ModalOptions|
| Option | Description | Data Attributes | Type | | --------------- | ----------------------------------------- | --------------- | ------------- | | autoInitModal | Automatically initialize the modal. | - | boolean | | isHidden | Check if the modal is hidden. | - | boolean | | showModal | Show the modal. | - | () => void | | hideModal | Hide the modal. | - | () => void |
Here's a simple example of how to use the Modal component:
<div>
<button data-modal-target="modal-alert" class="bg-neutral8 text-white px-4 py-2 rounded-lg text-sm">
Animate On Enter
</button>
<div data-modal-test-2 aria-hidden="true" data-modal-id="modal-alert"
data-modal-overlay="bg-gray8/70 backdrop-filter backdrop-blur-3xl" data-state="close"
class="hidden justify-center items-start p4 fixed wscreen hscreen top-0 left-0">
<dialog data-modal-content data-enter-animation="fadeScale .4s linear"
class="relative bg-white dark-bg-gray950 rd-lg overflow-hidden wfull max-wxl p8 flex flex-col gap-y4 items-center ease-linear transition-all">
<div class="wmax p3 rd-full bg-red2 text-red6">
<span flex i-carbon-trash-can text-lg></span>
</div>
<h2 class="font-semibold text-xl text-gray9 dark-text-white">
Confirm your action
</h2>
<p class="text-gray7 dark-text-gray3">
Are you sure you want to delete this event?
</p>
<div class="flex justify-center gap-x3 pt4">
<button data-close-modal
class="h9 text-sm flex items-center px5 rd-md bg-gray1 dark-bg-gray9 duration-300 hover-!bg-op60 text-gray8 dark-text-gray2">
No, Cancel
</button>
<button class="h9 text-sm flex items-center px5 rd-md bg-red6 duration-200 hover-bg-op80 text-white">
Yes, Delete
</button>
</div>
</dialog>
</div>
</div>
In this example, clicking the "Animate On Enter" button will show the modal. The modal can be closed by clicking the "No, Cancel" button or the "Yes, Delete" button. Used UnoCSS for this example for styling
FAQs
A customizable modal component for creating interactive pop-up dialogs in web applications.
We found that @flexilla/modal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.