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

@hozzijeong/react-modal

v0.0.2

Published

React에서 사용가능한 모달입니다.

Readme

React Modal From @hozzijeong

This is simple React Modal Component Library

Installation

  npm install @hozzijeong/react-modal

Components

Modal : Component that Modal Content

ModalContext : Modal Open State.

ModalProvider : Modal Layout. you have to 감싸야한다. ModalContext를 사용하기 위해서는.

useModal : custom hook that Modal Open And Close

How to Use

  1. <div id="modal-root"> </div>index.htmlbody 태그 제일 마지막에 추가한다.
<body>
  <div id="root"></div>
  <div id="modal-root"></div>
</body>
  1. 모달을 공유할 Layout에 <ModalProvider></ModalProvider>를 추가해 줍니다.
import { ModalProvider } from "@hozzijeong/react-modal";

<ModalProvider>{...children}</ModalProvider>;
  1. 그렇다면 다음과 같은 방식으로 modal을 사용할 수 있다.
// ...
const { openModal, isModalOpen, closeModal } = useModal();

<div>
  <button onClick={openModal}>{`open modal`}</button>
  {isModalOpen && ( // 조건부 렌더링을 통해 modal을 렌더링 할지 말지 결정한다.
    <Modal direction={direction}>
      <div>this is modal</div>
      <button onClick={closeModal}>close</button>
    </Modal>
  )}
</div>;
  1. isModalOpen은 Context API를 사용해서 ModalProvider를 감싼 하위 컴포넌트라면 전역적으로 접근이 가능하다.

  2. Modal의 Props는 아래와 같다.

interface ModalProps {
  direction?: Direction; // 모달이 열리는 방향 미지정시 "center"
  width?: string; // 모달 콘텐츠의 너비 미지정시 100%
  height?: string; // 모달 콘텐츠의 높이 미지정시 100%
  children: React.ReactNode; // 모달안에 들어갈 자식 컴포넌트
}

dependancy

react styled-components typescript