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

modal-package-martin-test

v0.1.5

Published

This modal package is a lightweight and customizable react component that allows you to easily display modal windows in your React applications. With this package, you can create and manage modal windows with minimal effort, providing a seamless user expe

Downloads

13

Readme

Description

This project was bootstrapped with Create React App

The Modal Package is a lightweight and customizable package that allows you to easily display modal windows in your React applications. With this package, you can create and manage modal windows with minimal effort, providing a seamless user experience.

image

##Installation To install the Modal Package, use the following command:

npm install modal-package-martin

Usage

This project needs to use useState with a variable showModal to toggle the modal visibility

const [showModal, setModal] = useState(false);

and a function to change its visibility

const handleClick = () => {
	setModal(() => !showModal)
}

The modal accepts three props:

  • showModal (a boolean that respresents the modal visibility)
  • onClick (a fn to change the modal visibility)
  • children (the elements that will be displayed in the modal content)
import Modal from 'modal-package-martin-test/dist/Modal'

// Example usage
const App = () => {
	const [showModal, setModal] = useState(false)

	const handleClick = () => {
		// Perform action to toggle modal
		setModal(() => !showModal)
	}

	return (
		<div className="container">
			<button onClick={handleClick}>Show Modal</button>
			<Modal showModal={showModal} onClick={handleClick}>
				{/* Modal content goes here */}
			</Modal>
		</div>
	)
}

Recomended html structure:

<>
      <div className="modal-header">
        <h5 className="modal-title">Modal title</h5>
      </div>
      <div className="modal-body">
        <p>Modal body text goes here.</p>
      </div>
</>

The classes "modal-header", "modal-title" and "modal-body" already have some default css rules than can be overridden using inle styling or regular a simple css file that targets these classes

Package Details

Package.json

{
	"name": "modal-package",
	"version": "0.1.0",
	"dependencies": {
		"@testing-library/jest-dom": "^5.16.5",
		"@testing-library/react": "^13.4.0",
		"@testing-library/user-event": "^13.5.0",
		"web-vitals": "^2.1.4"
	},
	"scripts": {
		"start": "react-scripts start",
		"build": "rm -rf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__",
		"test": "react-scripts test",
		"eject": "react-scripts eject"
	},
	"eslintConfig": {
		"extends": ["react-app", "react-app/jest"]
	},
	"browserslist": {
		"production": [">0.2%", "not dead", "not op_mini all"],
		"development": [
			"last 1 chrome version",
			"last 1 firefox version",
			"last 1 safari version"
		]
	},
	"devDependencies": {
		"babel-cli": "^6.26.0",
		"react": "^18.2.0",
		"react-dom": "^18.2.0",
		"react-scripts": "5.0.1"
	},
	"main": "dist/index.js",
	"module": "dist/index.js",
	"files": ["dist", "README.md"],
	"repository": {
		"type": "git",
		"url": "URL_OF_YOUR_REPOSITORY"
	}
}

Dependencies

The Modal Package has the following dependencies:

Dev Dependencies

The Modal Package has the following dev dependencies:

Repository

The Modal Package repository can be found at

Online Snadbox