1.0.17 • Published 4 years ago

modalar v1.0.17

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Modalar

Modalar is a small unopinionated react library for modals(dialogs) and alert.

Installation

Use npm or yarn to install modalar

NPM:

npm install modalar

yarn:

yarn install modalar

Usage

modal

import React from "react"
import { useModal, Modal } from "modalar"

const App = () => {
  const { toggle, show } = useModal()
  return (
    <div>
      <button onClick={toggle}>Show Modal</button>
      <Modal toggle={toggle} show={show}>
        <div>content of modal</div>
      </Modal>
    </div>
  )
}

export default App

alert

import React from "react"
import { showAlert } from "modalar"

const App = () => {
  return (
    <div>
      <button onClick={() => showAlert({ content: <div>content</div> })}>Show Alert</button>
    </div>
  )
}

export default App

Demo

modal

alert

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago