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

cookie-nice-modal

v0.0.5

Published

cookie's awesome nice modal wow~~~~

Downloads

11

Readme

cookie-nice-modal

모달을 렌더링하는 컴포넌트입니다. 다양한 옵션과 스타일을 받아 사용자에게 제공합니다.

설치 방법

npm i cookie-nice-modal

사용 예시

const App = () => {
  const [isOpen, toggleIsOpen] = useReducer(prev => !prev, false);

  return (
    <Modal open={isOpen} onClose={() => toggleIsOpen()} type="drawer">
      <Modal.Header title="카드사 선택" onClose={toggleIsOpen} />
      <Modal.Content>
        <SelectBank />
      </Modal.Content>
      <Modal.Footer
        buttonPosition="column-reverse"
        closeButton={{
          text: '취소',
          onClick: () => console.log('취소'),
        }}
        confirmButton={{
          text: '동의하고 확인하기',
          onClick: () => console.log('확인'),
        }}
      />
    </Modal>
  );
}

props (required)

  • open: boolean : 모달이 열려있는지 여부
  • onClose: (function) : 모달을 닫는 콜백함수를 제공해야 합니다.
  • type (ModalType) : dialog, drawer, drawer-top, drawer-left, drawer-right
    • drawer default 방향은 아래입니다.

props (optional)

  • style (ModalStyle) : dimmed와 modal 스타일을 줄 수 있습니다.
  • closeOnOutsideClick (boolean): 모달 외부 영역 클릭 시 닫기 여부를 설정할 수 있습니다. (default: true)
  • closeOnESCKeydown (boolean): 모달 내에서 esc 버튼 클릭 시 (default: true)

children (optional)

  • Header
  • Content
  • Footer

Header props (required)

  • title: (string) 모달의 타이틀을 설정할 수 있습니다.
  • onClose: (function) : 모달을 닫는 콜백함수를 제공해야 합니다.

Header props (optional)

  • style: (HeaderStyle): 헤더와 타이틀 스타일을 커스텀할 수 있습니다.
  • customCloseIcon (string): 커스텀 닫기 아이콘을 설정할 수 있습니다.
  • hideCloseIcon (boolean): 닫기 아이콘 숨김 여부를 설정할 수 있습니다.

Contents props (optional)

  • children: (ReactNode): 컨텐츠를 넣어주면 됩니다.
  • style: (ContentStyle): 스타일을 넣어줄 수 있습니다.

Footer props (optional)

  • style: Footer 스타일을 넣어줄 수 있습니다.

  • buttonPosition (ButtonPosition): 닫기 버튼과 확인 버튼의 배치를 결정할 수 있습니다.

    • row일 때 확인 버튼이 오른쪽, column일 때 확인 버튼이 아래가 default 입니다. ('row', 'row-reverse', 'column', 'column-reverse')
  • closeButton (closeButtonProps): 닫기 버튼에 대한 설정입니다

    • text: 닫기 버튼 텍스트 설정 default는 취소
    • style: 닫기 버튼 스타일을 넣어줄 수 있습니다.
    • customButton: 커스텀한 닫기버튼을 넣어줄 수 있습니다.
    • hide: 버튼을 숨길 수 있습니다.
    • button props: (HTMLButtonProps): html 기본 버튼
  • confirmButton (closeButtonProps): 확인 버튼에 대한 설정입니다.

    • text: 확인 버튼 텍스트 설정 default는 취소
    • style: 확인 버튼 스타일을 넣어줄 수 있습니다.
    • customButton: 커스텀한 확인버튼을 넣어줄 수 있습니다.
    • hide: 버튼을 숨길 수 있습니다.