Socket
Socket
Sign inDemoInstall

@react-max/modal

Package Overview
Dependencies
12
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @react-max/modal

Basic react modal popup


Version published
Maintainers
1
Created

Readme

Source

@react-max/modal

React modal dialogs. ⚛️

NPM JavaScript Style Guide

Install

For support for react <16.8

# If you use npm:
npm install --save @react-max/modal

# Or if you use Yarn:
yarn add @react-max/modal

Usage

import React, { Fragment, useState } from 'react'
import Modal from '@react-max/modal'

export default function App() {
  const [visible, setVisible] = useState(false);

  return (
    <Fragment>
      <button type="button" onClick={() => setVisible(true)}>
        open modal
      </button>

      <Modal
        title="Modal"
        visible={visible}
        onClose={() => setVisible(false)}
      >
        contents
      </Modal>
    </Fragment>
  );
}

Live Demo

Props

NameTypeDefaultDescription
visiblebooleanfalse
childrenReactNode
onClose() => void
titleReactNode
widthnumberstring520
zIndexnumber1000
maskbooleantrue
closeButtonReactNode
showsCloseButtonbooleantrue
isMaskClosablebooleantrue
isEscKeyClosablebooleantrue
isCenteredModebooleanfalse
isExpandedModebooleanfalse
modalClassNamestring
maskClassNamestring
bodyClassNamestring
contentClassNamestring
modalStyleCSSProperties
maskStyleCSSProperties
bodyStyleCSSProperties
contentStyleCSSProperties

Thanks

Support it by joining stargazers for this repository. :star:

License

MIT © almond-bongbong

Keywords

FAQs

Last updated on 07 Jan 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc