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

oc-p14-simple-react-modale

v0.2.7

Published

A simple react component modal for the OC P14 Whealth Health project

Downloads

11

Readme

React Modal: A simple react component modal for the OC P14 Whealth Health project

Overview

The React Modal is a customizable component that renders a pre-formatted modal for use in React projects. This component offers several features and options, such as:

Installation

To use the React Modal component, you can install it via npm:

npm install oc-p14-wh-react-modale

Usage

Importing the Modal Component

To use the Modal component, simply import it into your React file and define the desired children for the content of your modal. You can also define custom styles if you want to further customize your modal's appearance.

import { Modal } from @the_algar/oc-p14-react-modale

Example

<Modal
    hideModal={closeModal}
    styleModalBackground
    styleModal={{ padding: 25, backgroundColor: 'red' }}
    styleModalContent
    animation={true}
    closeButton={true}
>
    <h1>Your modal message here!</h1>
    <p>Add more text, an image, or an input field.</p>
</Modal>

State

The Modal component's functionality is controlled by the local state of the parent component. Therefore, the parent component requires state to work properly. You can use any variable names you prefer to track the state of the modal. I used modalIsOpen and setModalIsOpen in my example.

const [modalIsOpen, setModalIsOpen] = useState(false)

The initial state of the modal should be set to false. An action on the parent component changes the state to true.

const handleSubmit = () => { setModalIsOpen(true) }

This will display the Modal component:

{modalIsOpen && ( Customize the modal and message here! )}

Props

The following table lists the props available for the Modal component:

Name | Type | Description | Required ------------- | ------------- | ------------- | ------------- hideModale | Function | to close modal | required styleModaleBackground | Object | inline styles | optional styleModale | Object | inline styles | optional styleModaleContent | Object | inline styles | optional animation | Boolean | to activate or not the animation of the modal appear | required closeButton | Boolean | to display or not button close | required

1. hideModale prop

The "hideModal" prop is a function that closes the modal. You should provide a function to hide the modal when the user clicks the button or the background of the modal. This prop is required.

const closeModale = () => { setModaleIsOpen(false) }

2. styleModaleBackground prop

The "styleModaleBackground" prop receives inline styles for customizing the modal background.

3. styleModale prop

The "styleModaleBackground" prop receives inline styles for customizing the modal background.

4. styleModaleContent prop

The "styleModaleContent" prop receives inline styles for customizing the modal's content.

5. animation prop

The "animation" prop is required and can be set to true to enable the built-in animation effect or false to turn it off.

6. closeButton prop

The "closeButton" prop is required and receives a boolean value to determine whether the close button should be displayed (true) or not (false).

"closeButton" is required.

Contributing

Contributions are always welcome!

To contribute to this project, please follow these steps:

License

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

Acknowledgments