npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fusion-popup

v0.0.9

Published

A customizable Angular popup component with drag, resize, and animation support.

Readme

Popup Fusion

Popup Fusion is a lightweight and customizable popup component for Angular, designed to provide a seamless and flexible modal experience.

Installation

npm install fusion-popup

Usage

Import the FusionPopupComponent in your Angular module:

import { PopupFusionModule } from "fusion-popup";

@NgModule({
  imports: [FusionPopupComponent],
})
export class AppModule {}

Use the <fusion-popup> component in your template:

<fusion-popup [visible]="isVisible" [title]="'My Popup'" [width]="'500px'" [height]="'400px'">
  <p>Popup content goes here.</p>
</fusion-popup>

API

Inputs

| Property | Type | Default | Description | | ----------------- | -------------------------- | -------------------------- | --------------------------------------------------------- | | visible | boolean | false | Controls the visibility of the popup. | | title | string | '' | Title of the popup. | | width | string | '400px' | Width of the popup. | | height | string | '300px' | Height of the popup. | | shading | boolean | true | Enables/disables the background overlay. | | shadingColor | string | 'rgba(0, 0, 0, 0.2)' | Color of the background overlay. | | showCloseButton | boolean | true | Shows/hides the close button. | | dragEnabled | boolean | true | Enables/disables dragging. | | resizeEnabled | boolean | true | Enables/disables resizing. | | animation | FusionPopupAnimationType | 'fade' | Animation type for the popup. | | zIndex | number | auto | Sets the z-index of the popup. | | position | FusionPopupPositionType | 'top' | Position of the popup on the screen. | | component | any | undefined | Custom component to be displayed inside the popup. | | customTemplate | TemplateRef<any> | undefined | Custom template for the popup content. | | componentInputs | Record<string, unknown> | undefined | Dynamic inputs for the custom component. | | targetElemntId | string | '' | Target element ID for positioning the popup. | | dragEnabled | boolean | true | Enables/disables dragging functionality. | | resizeEnabled | boolean | true | Enables/disables resizing functionality. | | maxWidth | string | undefined | Maximum width of the popup. | | minWidth | string | '100px' | Minimum width of the popup. | | maxHeight | string | undefined | Maximum height of the popup. | | minHeight | string | '100px' | Minimum height of the popup. | | loading | boolean | false | Shows or hides the loading indicator. | | showHeader | boolean | true | Shows or hides the header of the popup. | | showFooter | boolean | true | Shows or hides the footer of the popup. | | buttons | FusionButtonProperties[] | [] | Array of buttons to be displayed inside the popup Footer. | | positionXY | object | { x: 0, y: 0 } | XY coordinates for the popup position. | | | | --------------- | ------------------------- | -------------------------- | -------------------------------------------------- | | visible | boolean | false | Controls the visibility of the popup. | | title | string | '' | Title of the popup. | | width | string | '400px' | Width of the popup. | | height | string | '300px' | Height of the popup. | | shading | boolean | true | Enables/disables the background overlay. | | shadingColor | string | 'rgba(0, 0, 0, 0.2)' | Color of the background overlay. | | showCloseButton | boolean | true | Shows/hides the close button. | | dragEnabled | boolean | true | Enables/disables dragging. | | resizeEnabled | boolean | true | Enables/disables resizing. | | animation | FusionPopupAnimationType | 'fade' | Animation type for the popup. |

Events

| Event | Type | Description | | ----------------- | -------------------------------------------------------------- | -------------------------------------------------- | | visibleChange | EventEmitter<boolean> | Emitted when the visibility of the popup changes. | | onOpened | EventEmitter<FusionOpenedEvent> | Emitted when the popup is opened. | | onClosed | EventEmitter<FusionClosedEvent> | Emitted when the popup is closed. | | onOptionChanged | EventEmitter<FusionOptionChangedEvent<FusionPopupComponent>> | Emitted when an option of the popup is changed. | | onContentLoaded | EventEmitter<FusionContentLoadedEvent<FusionPopupComponent>> | Emitted when the popup content is loaded. | | onDrag | EventEmitter<FusionDragEndEvent> | Emitted when the drag operation of the popup ends. | | onResize | EventEmitter<FusionResizeEvent> | Emitted when the popup is resized. | | onButtonClick | EventEmitter<FusionButtonClickEvent> | Emitted when a button inside the popup is clicked. |

Methods

| Method | Description | | -------------------------------------- | --------------------------------------------------------------- | | open() | Opens the popup. | | close() | Closes the popup. | | startLoading() | Shows a loading spinner inside the popup. | | stopLoading() | Hides the loading spinner. | | getComponent() | return the instance of component rendred dynamicly. | | disableButton(id: string): void | Disables the button with the specified id. | | enableButton(id: string): void | Enables the button with the specified id. | | hideButton(id: string): void | Hides the button with the specified id. | | showButton(id: string): void | Shows the button with the specified id. | | startButtonLoading(id: string): void | Starts the loading state on the button with the specified id. | | endButtonLoading(id: string): void | Ends the loading state on the button with the specified id. |

Dynamic Open Mode

PopupFusionService

The PopupFusionService allows you to create popups dynamically without needing to define them in the template.

Importing the Service

import { PopupFusionService } from "fusion-popup";

Creating a Popup Dynamically

step 1: set the service FusionPopupService as Application provider
import { FusionPopupService } from 'fusion-popup';

@Component({
  selector: 'app-root',
  imports: [],
  templateUrl: './app.component.html',
  styleUrl: './app.component.css',
  providers: [FusionPopupService],
})

constructor(private popupService: PopupFusionService) {}

openPopup() {
  const popupInstance = this.popupService.createPopup({
    title: 'Dynamic Popup',
    width: '500px',
    height: '400px',
    component : YourComponent
  });
}

Closing a Popup

this.popupService.closePopup(popupInstance.id);

Example

open popup with service

import { Component } from "@angular/core";
import { PopupFusionService } from "fusion-popup";

@Component({
  selector: "app-root",
  template: ` <button (click)="openPopup()">Open Popup</button> `,
})
export class AppComponent {
  constructor(private popupService: PopupFusionService) {}

  openPopup() {
    this.popupService.createPopup({
      title: "Dynamic Popup",
      width: "500px",
      height: "400px",
    });
  }
}

Example

handle button click and close popup

import { Component } from "@angular/core";
import { PopupFusionService } from "fusion-popup";

@Component({
  selector: "app-root",
  template: ` <button (click)="openPopup()">Open Popup</button> `,
})
export class AppComponent {
  constructor(private popupService: PopupFusionService) {}

  openPopup() {
    const popup = this.popupFusionService.createPopup({
      width: "700px",
      height: "200px",
      positionXY: { x: 0, y: 0 },
      title: "Popup Title",
      component: AppComponent,
      buttons: [
        {
          id: "close",
          text: "Close",
          type: "info",
          stylingMode: "outlined",
        },
      ],
    });

    popup.onButtonClick.subscribe((event: FusionButtonClickEvent) => {
      if (event.button.id === "close") {
        // controle the buttons properties from event.button
        event.button.loading = true;
        // controle the buttons properties from popup.button
        popup.startButtonLoading("close");
        // controle the popup form event
        event.popup.close();

        // controle the component rendred from outside and access to all public properties and methods
        const rendredComponent = popp.getComponent<YourComponent>();
        // controle the popup from instance
        popup.close();
      }
    });
  }
}

License

MIT