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

@droomwolk/react-a11y-modal

v1.0.8

Published

Modal React accessible (portal, focus trap, ARIA, clavier) sans dépendances

Readme

@droomwolk/react-a11y-modal

A reusable, accessible, and modern React modal component built by Droomwolk.

npm version npm downloads


📑 Table of Contents


🚀 Installation

Install the package using npm:

npm install @droomwolk/react-a11y-modal

or with Yarn:

yarn add @droomwolk/react-a11y-modal

🧩 Usage Example

import { useState } from "react";
import { Modal } from "@droomwolk/react-a11y-modal";

export default function App() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <>
      <button onClick={() => setIsOpen(true)}>Open modal</button>

      <Modal
        isOpen={isOpen}
        onClose={() => setIsOpen(false)}
        title="Accessible Modal"
        message="🎉 Hello from @droomwolk/react-a11y-modal!"
        okLabel="Close"
        onOk={() => setIsOpen(false)}
      />
    </>
  );
}

🖌️ Import Styles

To use the default theme, import the provided stylesheet:

import "@droomwolk/react-a11y-modal/dist/modal.css";

If you prefer a custom design, override the CSS classes to match your own style system.


⚙️ Component Interface

| Prop | Type | Description | Default | |------|------|--------------|----------| | isOpen | boolean | Controls modal visibility | false | | onClose | () => void | Triggered when modal closes | — | | onOk | () => void | Triggered when clicking the OK button | — | | title | string | Title displayed at the top | "Modal" | | message | string | Simple text message below the title | "" | | children | ReactNode | Custom JSX inside the modal | undefined | | showCloseButton | boolean | Shows or hides the ✕ button | true | | okLabel | string | Label for the main action button | "OK" | | closeOnBackdropClick | boolean | Allows closing by clicking the backdrop | true | | className | string | Additional CSS class for .modal | "" | | style | React.CSSProperties | Inline style for .modal | {} | | closeButtonStyle | React.CSSProperties | Inline style for the ✕ button | {} | | actionsClassName | string | Custom class for .modal-actions | "" | | actionsStyle | React.CSSProperties | Inline styles for .modal-actions | {} |


⌨️ Keyboard Support

| Key | Action | |-----|--------| | Escape | Closes the modal (onClose) | | Enter | Confirms the modal (onOk) |


🎨 Default CSS Classes

| Element | Class | |----------|--------| | Backdrop overlay | .modal-backdrop | | Main container | .modal | | Header section | .modal-header | | Title text | .modal-title | | Close button | .modal-close | | Body / Content | .modal-body | | Action area | .modal-actions |


💭 Minimal Style Example

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal {
  width: 550px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .2);
  overflow: hidden;
  animation: modalIn .18s ease-out;
}

.modal-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f8f8;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #0a2540; /* Navy */
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #dc143c;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.modal-close:hover { background: #f2f2f2; }

.modal-body {
  padding: 18px;
  color: #333;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 18px 18px;
}

.btn-primary {
  background-color: #0a2540;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.btn-primary:hover {
  background-color: #003366;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalIn {
  from { transform: translateY(-10px); opacity: 0.8; }
  to { transform: translateY(0); opacity: 1; }
}

🌐 Local Development

git clone https://github.com/droomwolk/react-a11y-modal.git
cd react-a11y-modal
npm install

Then modify the code inside src/ and publish a new version:

npm version patch
npm publish --access public

🔒 License

This project is licensed under the MIT License — see the LICENSE file for details.


👤 Author

Developed by Mickaël Beljio
💻 GitHub: @droomwolk
🌐 Website: https://droomwolk.dev