PicoModal is a lightweight, self-contained JavaScript library designed for creating modal dialogs. It boasts a minimal footprint, weighing approximately 2KB when minified and gzipped, and operates without any external JavaScript dependencies, making it highly embeddable in various environments. The library handles focus management, keyboard events (like Esc key closing), and ARIA attributes for accessibility out-of-the-box. Key differentiators include its plain vanilla JS approach, eliminating the need for jQuery or other frameworks, and its self-contained nature, requiring no separate CSS or image files. Despite these features, the package appears to be abandoned, with its latest stable version (3.0.0) published over nine years ago in September 2016. There is no active development or defined release cadence, and users should be aware of its long-term maintenance status.
npm install picomodalVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates creating a PicoModal with custom content, styling, a custom close button, and event handling. It shows how to obtain a modal instance and interact with its API.
Thoroughly review your existing PicoModal implementation and test all modal functionalities after upgrading to identify and address any behavioral changes. Consult the source code differences between v2.x and v3.x if issues arise.
For new projects, consider modern, actively maintained modal libraries. For existing projects, be prepared to fork and maintain the library yourself or plan for migration to a more current solution if security or feature needs arise.
If using a module bundler (Webpack, Rollup, Parcel), it will likely handle CJS/UMD output correctly. If attempting native ESM in browsers or Node.js, ensure the package is transpiled or served in a compatible UMD format, or consider explicitly loading it as a global script for simpler integration.
Ensure the `picomodal.min.js` script is correctly included in your HTML before your application script, or if using a module system, verify the import path and syntax (`import picoModal from 'picomodal';` for ESM, or `const picoModal = require('picomodal');` for CJS) is correct and the module is resolving.Verify that your `picoModal` call includes valid `content`. Check the browser's developer tools for any errors, and inspect the DOM to see if the modal elements (`.pico-overlay`, `.pico-modal`) are present but hidden. Ensure no global CSS is overriding `display: none` or `visibility: hidden` unexpectedly on these elements.
Ensure `overlayClose: true` and `escCloses: true` are set in the `picoModal` options if you desire these behaviors. If using custom close logic, ensure `modalInstance.close()` is correctly invoked in your event handlers.
No dependency data recorded yet.