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 🙏

© 2024 – Pkg Stats / Ryan Hefner

jy-oc-p14-ma-bibliotheque-de-composants

v0.2.3

Published

Une bibliothèque de composants React modulable et réutilisable pour projet OpenClassRoom, incluant un composant Modal personnalisable.

Downloads

12

Readme

Modal Component for React Applications : jy-oc-p14-ma-bibliotheque-de-composants

Description

This Modal component is designed for React applications, offering a flexible and easy-to-use solution for displaying modals. With customizable content, styles, and behaviors, this modal component can adapt to a wide variety of use cases.

Author

Julien YASSEF

Link to NPM

Modal Package

Features

  • Dynamic Visibility: Control the display of the modal with an isOpen prop.
  • Customizable Styling: Override default styles for the modal, title, content, and close icon through CSS classes.
  • Close Mechanisms: Supports closing the modal through a close icon, pressing the ESC key, clicking outside the modal, or a custom close text link.
  • Accessibility Features: Implements focus management and supports disabling background content scrolling when the modal is open.
  • Animation Controls: Customize fade-in and fade-out animations for both the overlay and the modal content with duration and delay options.

Prerequies

Node version LTS IDE VSCODE

Installation

To incorporate jy-oc-p14-ma-bibliotheque-de-composants into your project, run the following npm command:

bash npm install jy-oc-p14-ma-bibliotheque-de-composants

Include the Modal.css file in your project to get started with the default styling. You can import it in your main application file like so: import 'jy-oc-p14-ma-bibliotheque-de-composants/src/libModal.css';

Props of the modal

| Prop | Type | Description | Default | |-----------------------|---------------------|-------------------------------------------------------------------------------|--------------------| | isOpen | boolean | Controls the visibility of the modal. | Required | | title | string | The title displayed at the top of the modal. | None | | content | JSX.Element/string| The content of the modal, can be text, JSX, or any React component. | Required | | handleClose | Function | Function to call when the modal needs to be closed. | Required | | modalClass | string | CSS class for the modal. | "modal" | | titleClass | string | CSS class for the modal title. | "modalTitle" | | contentClass | string | CSS class for the modal content. | "modalContent" | | closeIcon | JSX.Element | Custom JSX for the close icon. | Default SVG icon | | enableCloseIconClick| boolean | If false, clicking the close icon will not close the modal. | true | | escapeClose | boolean | Allows the modal to be closed by pressing the escape key. | false | | closeOnClickOutside | boolean | Allows the modal to be closed by clicking outside its content area. | false | | disableScroll | boolean | Disables scrolling of the background content when the modal is open. | false | | centeredModal | boolean | Centers the modal in the window. | false | | fadeDurationOverlay | number | Fade effect duration for the overlay in milliseconds. | 0 | | fadeDelayOverlay | number | Delay before the fade effect for the overlay starts, in milliseconds. | 0 | | fadeDurationModal | number | Fade effect duration for the modal itself in milliseconds. | 0 | | fadeDelayModal | number | Delay before the fade effect for the modal content starts, in milliseconds. | 0 | | closePreviousOnOpen | boolean | Automatically closes previous modals when a new modal is opened. | false | | closeLink | string | Optional text for a close link. | None | | linkCloseClass | string | CSS class for the close link. | "linkClose" | | closeClass | string | CSS class for the close button. | 'customClose' |