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

@chemaalfonso/modalizer

v2.0.0

Published

Generate attractive native modals efficiently.

Downloads

17

Readme

✨ Features

  • Native: Keep the native way using native dialog html element.
  • Ease of Use: Implement modals in minutes with a simple and user-friendly API.
  • Keep your rules: Modalizer only modalizes your content but you still have all its control.
  • Dependency free: Modalizer use 0 dependencies.
  • Quick Customization: Adapt the appearance of your modals to fit your project.
  • Custom HTML Content: Effortlessly load any HTML content into your modals.
  • Compatible animations: Compatible with Animate.css animations
  • Customizable animations: Make your own and use custom animations
  • Created in TypeScript: Modalizer is designed for use in TypeScript and JavaScript projects.
  • Only 3.3kb minimified incuding styles
  • Responsive: Native elements fits your needs on every screen
  • Free use: MIT licensed

👀 Demo

View working example

⚙️ Installation

To use Modalizer in your project, you can:

Direct use from cdn

  1. Basic styles:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@chemaalfonso/modalizer/dist/css/styles.min.css">
  1. (Optional) Extra animations:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@chemaalfonso/modalizer/dist/css/animate.min.css">
  1. Script:
    <script type="module">
        import { Modalizer } from 'https://cdn.jsdelivr.net/npm/@chemaalfonso/modalizer/dist/modalizer.min.js'
    </script>

Install via npm

npm i @chemaalfonso/modalizer

📝 Usage

Import into your project

  1. Include style rules:

    // Basic css styles with fade in & out default animations
    import '@chemaalfonso/modalizer/dist/css/styles.css';
    
    // (Optional) Extra animate.css animations
    import '@chemaalfonso/modalizer/dist/css/animate.css';
  2. Import & use script:

    Minimal example with HTML trigger

    import { Modalizer, Modalizable } from '@chemaalfonso/modalizer'
    
    // Define your modal content and trigger elements
    const element = document.querySelector('your-modal-content') as HTMLElement
    const trigger = document.querySelector('your-modal-trigger') as HTMLElement
    
    // Create a Modalizer instance
    const modalizer = new Modalizer({ element, trigger })

    Programatic modal invocation

    import { Modalizer, Modalizable } from '@chemaalfonso/modalizer'
    
    // Define your modal content
    const element = document.querySelector('your-modal-content') as HTMLElement
    
    // Create a Modalizer instance
    const modalizer = new Modalizer({ element })
    
    // Show modal
    modalizer.show()
    
    // Hide modal
    modalizer.hide()

🛠️ Configuration

Using config object


import { ModalizerConfig } from '@chemaalfonso/modalizer'

const config: ModalizerConfig = {
	animationIn: 'myInAnimation',
	animationOut: 'myOutAnimation',
	closeOnEscKeyPress: true,
	closer: myHtmlCloserElement,
	customClassName: 'my-class-name'
}

Config options reference

| Property Name | Default Value | Description | |----------------------|--------------------------------|-------------------------------------------------------------------| | animationIn | 'modalizer-fadeIn' | The css class name with the animation for modal entry. | | animationOut | 'modalizer-fadeOut' | The css class name with the animation for modal exit. | | closeOnEscKeyPress | true | Controls whether the modal is closed when pressing "Cancel." | | closer | undefined | Optional: The HTML element to close the modal. | | customClassName | undefined | Optional: Allows setting a CSS class to customize the modal. |

🎨 Styling

Customizing styles

Include a custom class name


import { ModalizerConfig } from '@chemaalfonso/modalizer'

const config: ModalizerConfig = {
	customClassName: 'my-class-name',
	...
}

Apply your styles

.my-class-name {
	--modalizer-animation-duration: 0.4s;
	border-radius: 8px;
}

.my-class-name::backdrop {
	background: #6749e39f;
}

💃 Using animations

You can use any animation source. The only requeriment is a css class with the animation property and use it on the config object.

Using Animate.css animations

Include animate.css rules

import '@chemaalfonso/modalizer/dist/css/animate.css';

⚠️ Modalizer package includes a simplified animate.css version including only the in & out based animations.

Use Animate.css animation class names on config


import { ModalizerConfig } from '@chemaalfonso/modalizer'
import { MODALIZER_ANIMATE_ANIMATION_IN, MODALIZER_ANIMATE_ANIMATION_OUT } from '@chemaalfonso/modalizer/dist/animateAnimations'

const config: ModalizerConfig = {
	animationIn: MODALIZER_ANIMATE_ANIMATION_IN.LIGHTSPEED_IN_LEFT,
	animationOut: MODALIZER_ANIMATE_ANIMATION_OUT.FLIP_OUT_X
}

Creating custom animations

  1. Create your custom animation and assign to css classes:

    
    .fadeIn {
    	animation: fadeIn 0.25s forwards;
    }
    
    .fadeOut {
    	animation: fadeOut 0.25s forwards;
    }
    
    @keyframes fadeIn {
    	0% {
    		opacity: 0;
    	}
    	100% {
    		opacity: 1;
    	}
    }
    
    @keyframes fadeOut {
    	0% {
    		opacity: 1;
    	}
    	100% {
    		opacity: 0;
    	}
    }
  2. Use created css classes on config object:

    
    import { ModalizerConfig } from '@chemaalfonso/modalizer'
    
    const config: ModalizerConfig = {
    	animationIn: 'fadeIn',
    	animationOut: 'fadeOut'
    }

🔦 Linting

  • npm run lint: Run linter
  • npm run lint:fix: Fix lint issues

🔨 Dev

  • npm run dev: Run tsc transpiler with watcher
  • npm run dev:styles: Run styles compiler with watcher

📚 Build

  • npm run build: Run project builder

📄 License

Modalizer is licensed under the MIT LICENSE. See the LICENSE file for details.

📱 Contact

If you have any questions or suggestions, feel free to open an issue.