🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@jmind.systems/react-modal

Package Overview
Dependencies
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jmind.systems/react-modal

**[aphrodite](https://www.npmjs.com/package/aphrodite) is required for react-modal to work** ### Example [codesandbox](https://codesandbox.io/s/brave-austin-u81bv?file=/src/App.js) ## Docs

latest
Source
npmnpm
Version
0.0.27
Version published
Maintainers
4
Created
Source

React-Modal

aphrodite is required for react-modal to work

Example

codesandbox

Docs

  • addModal - takes a modal name. Use to open modal.
  • removeModal - takes a modal name. Use to close modal.
  • subscribeToModal: (name, callback: (isOpen)) - callback will be trigger on modal open/close
  • name: string - The modal name should be unique
  • children: ReactNode - modal content
  • type: string: submit, confirm, custom
  • onClose?: function
  • onSubmit?: function - will be triggered when the user clicks on submit button
  • settings?: object - use this parameter to pass custom settings:
    • rootStyles: object
    • overlayStyles: object
    • withCloseBtn: boolean (default true) - Using this prop you can show
      or hide close btn (cross.svg)
    • closeStyles: object
      • svg: object - Use to change close btn position, size, etc.
      • path: object - Use to change close button color
  • controlsSettings?: object
    • cancel: object - cancel button settings.
      • text: string | React.Element - cancel button text
      • styles: object - styles for cancel button. Use this
        parameter to change default button styles.
    • submit: object - submit button settings
      • text: string | React.Element - submit button text
      • styles: object - styles for submit button. Use this
        parameter to change default button styles.
    • wrapper: object - There is a parant div around cancel and submit buttons. Use this parameter to change wrapper style (margin, background, etc.)
  • closeIcon?: function This prop can be used to pass custom close component, for example text.
  • portalId?:string (default - modal) - By default you should have root div with id="modal" ().

Keywords

modal

FAQs

Package last updated on 26 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts