JSPM

dotoli-popup

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q12776F
  • License MIT

Package Exports

  • dotoli-popup

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dotoli-popup) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Dotoli-Popup Guide

πŸ₯³ 화면이 꽉찬 Modal / Popup을 μ’€ 더 νŽΈν•˜κ³  κΉ”λ”ν•˜κ²Œ μ“°κ³  μ‹Άμ–΄ λ§Œλ“  라이브러리

μ˜ˆμ‹œλŠ” example 폴더λ₯Ό 확인 λΆ€νƒλ“œλ¦½λ‹ˆλ‹€.

Install Guide

npm install dotoli-popup
# OR
yarn add dotoli-popup

Getting Started

The Gist

import { render } from 'react-dom';
import popup, { PopupContainer } from 'dotoli-popup';
import Popup from './Popup';  // React Component

const App = () => {
  const onClick = () => {
    // Popup Open 
    popup.open({
      id: 'popup',
      render: Popup,
      props: {
        header: 'Lorem ipsum',
        onCloseClick: () => {
          // Popup Close
          popup.close('popup');
        },
      },
      onClose: () => console.log('On Close Event'),
      backgroundCloseable: true,
      onOpen: () => console.log('On Open Event'),
    });
  };

  return (
    <div>
      <PopupContainer />
      <button onClick={onClick}>Open modal</button>
    </div>
  );
};

render(<App />, document.getElementById('root'));

Use NextJS

// pages/_app.tsx or pages/_app.js
import { AppProps } from 'next/app';
import { PopupContainer } from 'dotoli-popup';

const App = ({ Component, pageProps }: AppProps) => (
  <>
    <PopupContainer />
    <Component {...pageProps} />
  </>
);

export default App;

popup.open Props

key required default description
id βœ… νŒμ—… ID둜 μ’…λ£Œ 및 popup ꡬ뢄에 μ“°μž„
render βœ… νŒμ—… Component
props νŒμ—… Component 의 Props
onClose νŒμ—… μ’…λ£Œ μ‹œ μ‹€ν–‰ 이벀트
onOpen νŒμ—… μ˜€ν”ˆ μ‹œ μ‹€ν–‰ 이벀트
backgroundClosealbe false νŒμ—… Component λ°–μ˜ μ˜μ—­ 클릭 μ‹œ μ’…λ£Œ μ—¬λΆ€