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

@muffin2219/components

v0.0.14

Published

Modal components module

Downloads

16

Readme

Modal Components

본 모듈은 React 애플리케이션에서 사용할 수 있는 모달 컴포넌트를 제공합니다.

💡 Installation

npm i @muffin2219/components

📚 Documentation

모달 컴포넌트의 사용 방법과 예제를 확인하려면 Storybook 문서를 참조하세요.

📖 Storybook으로 확인하기

Storybook에서는 다음과 같은 정보를 확인할 수 있습니다.

  • 기본 모달 및 다양한 변형 예시
  • 모달의 다양한 상태와 스타일링 옵션 미리보기
  • 인터랙티브 컨트롤을 통한 실시간 속성 변경 테스트

🔧 Modal Component Props

| Name | Datatype | Default | Description | | --------------- | ------------------------------------------------- | -------- | ---------------------------------------------------------- | | position | 'center' | 'bottom' | 'center' | 모달의 위치를 지정합니다 | | size | 'small' | 'medium' | 'large' | - | 모달의 크기를 지정합니다 | | title | { text?: string; color?: string; size?: number; } | - | 모달의 제목과 스타일을 설정합니다 | | showCloseButton | boolean | true | 닫기 버튼 표시 여부를 설정합니다 | | backgroundColor | string | - | 모달의 배경색을 설정합니다 | | children | ReactNode | - | 모달 내부에 표시될 콘텐츠입니다 | | alert | {message: string} | - | 모달 컨텐츠를 주어진 메시지와 함께 Alert 형태로 띄웁니다 | | confirm | {message: string} | - | 모달 컨텐츠를 주어진 메시지와 함께 Confirm 형태로 띄웁니다 | | prompt | boolean | {message: string} | - | 모달 컨텐츠를 주어진 메시지와 함께 Prompt 형태로 띄웁니다 | | isOpen | boolean | - | 모달의 열림 상태를 제어합니다 | | onClose | () => void | - | 모달을 닫는 함수입니다 | | onConfirm | (value?:string) => void | - | 모달 내 확인 버튼에 등록하는 함수입니다 |

📌 How to use

import {Modal} from '@muffin2219/components';
import {useState} from 'react';
import './App.css';

function App() {
  const [isOpen, setIsOpen] = useState(false);

  const closeModal = () => setIsOpen(false);
  const openModal = () => setIsOpen(true);

  return (
    <>
      <button type="button" onClick={openModal}>
        모달 열기
      </button>
      <Modal isOpen={isOpen} onClose={closeModal}>
        <div style={{padding: '20px'}}>
          <h3>모달 내용</h3>
          <p>
            모달 컴포넌트의 children으로 다양한 콘텐츠를 추가할 수 있습니다.
          </p>
          <button onClick={closeModal}>닫기</button>
        </div>
      </Modal>
    </>
  );
}

export default App;

🎨 Customizing Modal

import {Modal} from '@muffin2219/components';
import {useState} from 'react';
import './App.css';

function App() {
  const [isOpen, setIsOpen] = useState(false);

  const closeModal = () => setIsOpen(false);
  const openModal = () => setIsOpen(true);

  return (
    <>
      <button type="button" onClick={openModal}>
        모달 열기
      </button>
      <Modal
        isOpen={isOpen}
        onClose={closeModal}
        position="bottom"
        title={{
          text: '알림',
          color: '#4a154b',
          size: 24,
        }}
        backgroundColor="#f5f5f5"
      >
        <div style={{padding: '20px'}}>
          <p>다양한 props를 통해 모달을 커스터마이징할 수 있습니다.</p>
          <button onClick={closeModal}>확인</button>
        </div>
      </Modal>
    </>
  );
}

export default App;

Alert Modal

import {Modal} from '@muffin2219/components';
import {useState} from 'react';
import './App.css';

function App() {
  const [isOpen, setIsOpen] = useState(false);

  const closeModal = () => setIsOpen(false);
  const openModal = () => setIsOpen(true);

  return (
    <>
      <button type="button" onClick={openModal}>
        모달 열기
      </button>
      <Modal
        isOpen={isOpen}
        onClose={closeModal}
        title={{
          text: 'Alert Modal',
        }}
        alert={{message: 'Alert 모달 입니다'}}
      />
    </>
  );
}

export default App;

Confirm Modal

import {Modal} from '@muffin2219/components';
import {useState} from 'react';
import './App.css';

function App() {
  const [isOpen, setIsOpen] = useState(false);

  const closeModal = () => setIsOpen(false);
  const openModal = () => setIsOpen(true);

  return (
    <>
      <button type="button" onClick={openModal}>
        모달 열기
      </button>
      <Modal
        isOpen={isOpen}
        onClose={closeModal}
        title={{
          text: 'Confirm Modal',
        }}
        confirm={{message: 'Confirm 모달 입니다'}}
      />
    </>
  );
}

export default App;

Prompt Modal

import {Modal} from '@muffin2219/components';
import {useState} from 'react';
import './App.css';

function App() {
  const [isOpen, setIsOpen] = useState(false);

  const closeModal = () => setIsOpen(false);
  const openModal = () => setIsOpen(true);

  return (
    <>
      <button type="button" onClick={openModal}>
        모달 열기
      </button>
      <Modal
        isOpen={isOpen}
        onClose={closeModal}
        title={{
          text: 'Prompt Modal',
        }}
        prompt
        size="large"
      />
    </>
  );
}

export default App;

👥 Author

sooyeoniya, minji2219