1.4.2 • Published 2 years ago

@jdthornton/modal v1.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@jdthornton/modal

npm (scoped) npm bundle size (minified)

React modal component.

Demo

https://jdthornton.github.io/#/modal

Install

$ npm install @jdthornton/modal

Usage

import Modal, { useModal } from "@jdthornton/modal";
import "@jdthornton/modal/styles.css";

function App(){

  const { isOpen, open, close } = useModal();

  return isOpen ? (
    <Modal close={close}>
      Modal
    </Modal>
  ) : null
}

Props

PropTypeDescription
showCloseButtonbooleanShows a modal close button
closeOnOverlayClickbooleanCloses the modal on overlay click
closeOnEscbooleanCloses the modal on 'ESC' key press
inertQuerySelectorstringThe query selector for the element to be made inert when the modal is open
classNamestringThe modal class
styleobjectThe modal style
overlayClassNamestringThe overlay class
overlayStyleobjectThe overlay style
labelledBystringThe aria-labelledby attribute
describedBystringThe aria-describedby attribute
1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.9

2 years ago

1.3.7

3 years ago

1.2.8

3 years ago

1.3.6

3 years ago

1.2.7

3 years ago

1.3.5

3 years ago

1.2.6

3 years ago

1.3.4

3 years ago

1.2.5

3 years ago

1.3.3

3 years ago

1.2.4

3 years ago

1.3.2

3 years ago

1.2.3

3 years ago

1.3.1

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.3.8

3 years ago

1.2.9

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago