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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@alibee/react-modal

v1.0.4

Published

Un composant de fenêtre modale simple, léger et personnalisable pour React

Downloads

16

Readme

@alibee/react-modal

Un composant de fenêtre modale simple, léger et personnalisable pour React.

npm version license

📦 Installation

npm install @alibee/react-modal
# ou
yarn add @alibee/react-modal

🔧 Utilisation basique

import { Modal } from '@alibee/react-modal';
import '@alibee/react-modal/dist/style.css';

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

  return (
    <div>
      <button onClick={() => setIsOpen(true)}>
        Ouvrir la modale
      </button>

      <Modal
        isOpen={isOpen}
        onClose={() => setIsOpen(false)}
        title="Titre de la modale"
        size="md"
      >
        <p>Contenu de votre modale ici</p>
      </Modal>
    </div>
  );
}

🎯 Exemple d'utilisation réel

Voici un exemple d'utilisation dans une application de gestion des ressources humaines :

import { useState } from 'react';
import { Modal } from '@alibee/react-modal';
import '@alibee/react-modal/dist/style.css';

function CreateEmployee() {
  const [isModalOpen, setIsModalOpen] = useState(false);
  
  // Boutons personnalisés pour le pied de page
  const modalFooter = (
    <>
      <button 
        onClick={() => navigate('/employee-list')}
        className="button button-primary"
      >
        Voir la liste des employés
      </button>
      <button 
        onClick={() => setIsModalOpen(false)}
        className="button button-danger"
      >
        Fermer
      </button>
    </>
  );

  return (
    <div>
      {/* Votre formulaire ici */}
      
      <Modal 
        isOpen={isModalOpen} 
        onClose={() => setIsModalOpen(false)}
        title="Employé créé"
        size="md"
        footer={modalFooter}
        closeOnEscape={true}
        closeOnClickOutside={true}
      >
        <div className="message message-success">
          L'employé a été créé avec succès et ajouté à la liste des employés.
        </div>
        <p>
          Vous pouvez maintenant créer un autre employé ou consulter la liste des employés existants à l'aide des boutons ci-dessous.
        </p>
      </Modal>
    </div>
  );
}

🎨 Props

| Prop | Type | Par défaut | Description | |------|------|------------|-------------| | isOpen | boolean | Requis | Contrôle l'état d'ouverture de la modale | | onClose | () => void | Requis | Fonction appelée lors de la fermeture | | children | ReactNode | Requis | Contenu à afficher dans le modal | | className | string | '' | Classes CSS additionnelles | | closeOnEscape | boolean | true | Si true, le modal se ferme avec la touche Escape | | closeOnClickOutside | boolean | true | Si true, le modal se ferme en cliquant à l'extérieur | | size | 'sm' \| 'md' \| 'lg' | 'md' | Taille du modal | | footer | ReactNode | - | Contenu du pied de modal (optionnel) | | title | string | - | Titre du modal (optionnel) |

🎨 Personnalisation

Le composant Modal utilise des classes CSS que vous pouvez surcharger :

.modal-overlay {
  /* Styles de l'overlay */
}

.modal {
  /* Styles du conteneur principal */
}

.modal-sm {
  /* Styles pour la taille small */
  max-width: 400px;
}

.modal-md {
  /* Styles pour la taille medium
  max-width: 550px;
}

.modal-lg {
  /* Styles pour la taille large */
  max-width: 700px;
}

.modal-title {
  /* Styles du titre */
}

.modal-content {
  /* Styles du contenu */
}

.modal-footer {
  /* Styles du pied de page */
}

.modal-close {
  /* Styles du bouton de fermeture */
}

📦 Versions

  • React 16.8.0 ou supérieur
  • React DOM 16.8.0 ou supérieur

🔒 Licence

MIT © Babali61