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

hash-modal

v0.1.6

Published

npm modules

Readme

Button Module 사용 가이드

Modal Component 사용 방법

설치

npm install hash-modal

사용법

Modal 컴포넌트는 다음과 같이 사용할 수 있습니다.

import React from "react";
import Modal from "hash-modal";
function App() {
  const handleConfirm = (event) => {
    console.log("Confirmed!");
  };
  const handleClose = (event) => {
    console.log("Closed!");
  };
  return (
    <div>
      <Modal
        title="Modal Title"
        hasXButton={true}
        handleClose={handleClose}
        handleConfirm={handleConfirm}
        position="center" // "center" 또는 "bottom"
        buttonLayout="row" // "row" 또는 "column"
        confirmButtonContent="확인"
        closeButtonContent="취소"
      >
        <p>This is the content of the modal!</p>
      </Modal>
    </div>
  );
}
export default App;

Props

Modal 컴포넌트는 다음과 같은 props를 받을 수 있습니다.

  • title (string): 모달의 제목을 설정합니다.
  • hasXButton (boolean): 우측 상단에 X 버튼의 표시 여부를 결정합니다. 기본값은 true입니다.
  • handleClose (function): 모달을 닫을 때 실행할 함수입니다.
  • handleConfirm (function): 확인 버튼을 클릭할 때 실행할 함수입니다.
  • position (string): 모달의 위치를 설정합니다. "center" 또는 "bottom" 중 선택할 수 있습니다. 기본값은 "center"입니다.
  • buttonLayout (string): 버튼의 배열 방향을 설정합니다. "row" 또는 "column"을 사용할 수 있습니다. 기본값은 "row"입니다.
  • confirmButtonContent (string): 확인 버튼의 텍스트를 설정합니다. 기본값은 "확인"입니다.
  • closeButtonContent (string): 닫기 버튼의 텍스트를 설정합니다.

스타일링

Modal 컴포넌트는 styled-components를 사용하여 스타일을 적용할 수 있습니다. 기본적으로 제공되는 스타일 이외에 추가적인 커스터마이징이 필요한 경우, 컴포넌트를 더 상세히 조정할 수 있습니다.

이 문서가 컴포넌트의 사용 방법을 이해하는 데 도움이 되길 바랍니다. 필요에 따라 추가적인 정보를 더 제공할 수 있으므로 필요한 경우 개발자에게 문의하시기 바랍니다.


기능 요구사항

모달 컴포넌트

  • [x] 모달 위치: 중앙, 하단 등 모달 내용: 제목, 버튼 등

  • [x] 사용자 정의 이벤트 핸들러를 지원해야 한다.

  • [x] 모달 열기, 닫기, 확인 등의 동작에 대한 이벤트 핸들러

  • [x] 모달 컴포넌트를 npm으로 배포하고 사용할 수 있어야 한다.

  • 모달 구성 요소

    • modal-backdrop

    • modal 컨테이너

      • position
      • title
      • contents(children)
      • closeButtonType
      • closeButtonContent
      • confirmButton
      • confirmButtonContent
      • confirmEvent