项目作者: nadiamariduena

项目描述 :
Really simple Modal with "react-modal"
高级语言: JavaScript
项目地址: git://github.com/nadiamariduena/react-modal1.git
创建时间: 2020-09-17T18:08:08Z
项目社区:https://github.com/nadiamariduena/react-modal1

开源协议:

下载


CREATING MY FIRST MODAL

I ve been looking for a simple modal and i think this version is the easiest one,as you can also find really cool but a bit difficult with Framer Motion.





This Modal is really easy to understand

https://youtu.be/10FNqoPpNbE - Watch the tutorial!
youtube




PREVIEW

Styles passed into the Modal via the style prop are merged with the defaults. The default styles are defined in the Modal.defaultStyles object and are shown below.

  1. <Modal
  2. style={{
  3. overlay: {
  4. position: 'fixed',
  5. top: 0,
  6. left: 0,
  7. right: 0,
  8. bottom: 0,
  9. backgroundColor: 'rgba(255, 255, 255, 0.75)'
  10. },
  11. content: {
  12. position: 'absolute',
  13. top: '40px',
  14. left: '40px',
  15. right: '40px',
  16. bottom: '40px',
  17. border: '1px solid #ccc',
  18. background: '#fff',
  19. overflow: 'auto',
  20. WebkitOverflowScrolling: 'touch',
  21. borderRadius: '4px',
  22. outline: 'none',
  23. padding: '20px'
  24. }
  25. }}
  26. >




https://reactcommunity.org/react-modal/styles/ - more!
react







Dependencies


  1. npm i react
  2. npm i react-dom
  3. npm i react-scripts
  4. npm i react-router-dom
  5. npm i node-sass --save
  6. npm i autoprefixer@9.8.0
  7. npm i gh-pages --save-dev
  8. npm i gsap
  9. npm i react-modal

Tutorial by: Codevolution (Practical React - 4 - Modal)