@hawk-ui/modal

4.5.0 • Public • Published

Installation

To install a component run

$ npm install @hawk-ui/modal --save

Please import CSS styles via

@import '/path__to__node_modules/@hawk-ui/modal/dist/index.min.css

Usage

With Close Button and background dark

Demo

import Modal from '@hawk-ui/modal';
initialState = {
  isOpen: false,
};

<div>
  <Modal
    isOpen={state.isOpen}
    bgScroll={false}
    hideCloseIcon
    type="dark"
    title="Modal Title"
    position="center"
    onKeyDown={(event) => {
      setState({ isOpen: false });
    }}
    onClose={() => {
      setState({ isOpen: false });
    }}
  >
    <div>
      <div style={{ marginTop: '20px' }}>Modal Box</div>
    </div>
  </Modal>

  <button
    type="button"
    className="hawk-button"
    onClick={() => {
      setState({ isOpen: !state.isOpen });
    }}
  >
    Modal With Close Option
  </button>
</div>

Without Close Button and background light

Demo

import Modal from '@hawk-ui/modal';
initialState = {
  isOpen: false,
};

<div>
  <Modal
    isOpen={state.isOpen}
    type="light"
    position="center"
    onKeyDown={(event) => {
      setState({ isOpen: false });
    }}
    onClose={() => {
      setState({ isOpen: false });
    }}
  >
    <div>
      <div style={{ fontSize: '24px', fontWeight: '500', color: '#555555' }}>Title</div>
      <div style={{ marginTop: '20px' }}>Modal Box</div>
    </div>
  </Modal>

  <button
    type="button"
    className="hawk-button"
    onClick={() => {
      setState({ isOpen: !state.isOpen });
    }}
  >
    Modal Without Close Option
  </button>
</div>

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.5.06latest

Version History

VersionDownloads (Last 7 Days)Published
4.5.06
4.4.91
4.4.83
4.4.73
4.4.62
4.4.52
4.4.42
4.4.31
4.4.22
4.4.12
4.4.01
4.3.91
4.3.81
4.3.71
4.3.62
4.3.51
4.3.41
4.3.32
4.3.22
4.3.11
4.3.02
4.2.92
4.2.81
4.2.71
4.2.61
4.2.52
4.2.41
4.2.31
4.2.21
4.2.12
4.2.01
4.1.91
4.1.82
4.1.70
4.1.60
4.1.50
4.1.40
4.1.30
4.1.20
4.1.10
4.1.00
4.0.90
4.0.80
4.0.70
4.0.60
4.0.50
4.0.40
4.0.30
4.0.20
4.0.10
4.0.00
3.1.90
3.1.80
3.1.70
3.1.50
3.1.40
3.1.30
3.1.20
3.1.10
3.1.00
3.0.90
3.0.80
3.0.70
3.0.60
3.0.50
3.0.40
3.0.30
3.0.20
3.0.10
3.0.00
2.13.20
2.13.10
2.13.00
2.12.100
2.12.90
2.12.80
2.12.70
2.12.60
2.12.50
2.12.40
2.12.30
2.12.20
2.12.10
2.11.90
2.11.80
2.11.70
2.11.60
2.11.50
2.11.40
2.11.30
2.11.20
2.11.10
2.11.00
2.10.90
2.10.80
2.10.70
2.10.60
2.10.50
2.10.10
2.10.00
2.9.90
2.9.80
2.9.60
2.9.50
2.9.40
2.9.30
2.9.20
2.9.10
2.9.00
2.8.90
2.8.80
2.8.70
2.8.60
2.8.50
2.8.40
2.8.30
2.8.20
2.8.10
2.8.00
2.7.90
2.7.80
2.7.70
2.7.60
2.7.50
2.7.40
2.7.30
2.7.20
2.7.10
2.6.80
2.6.70
2.6.60
2.6.50
2.6.40
2.6.30
2.6.20
2.6.10
2.6.00
2.5.90
2.5.80
2.5.70
2.5.60
2.5.50
2.5.40
2.5.30
2.5.20
2.5.10
2.5.00
2.4.90
2.4.80
2.4.70
2.4.60
2.4.50
2.4.40
2.4.30
2.4.20
2.4.10
2.4.00
2.3.90
2.3.80
2.3.70
2.3.60
2.3.50
2.3.40
2.3.30
2.3.20
2.3.10
2.3.00
2.2.90
2.2.80
2.2.70
2.2.60
2.2.51
2.2.40
2.2.30
2.2.20
2.2.10
2.2.00
2.1.90
2.1.80
2.1.70
2.1.60
2.1.50
2.1.40
2.1.30
2.1.20
2.1.10
2.1.00
2.0.90
2.0.80
2.0.70
2.0.60
2.0.50
2.0.40
2.0.30
2.0.20
2.0.10
2.0.00
1.9.100
1.9.90
1.9.80
1.9.70
1.9.60
1.9.50
1.9.40
1.9.30
1.9.20
1.9.10
1.9.00
1.8.90
1.8.80
1.8.70
1.8.60
1.8.50
1.8.40
1.8.30
1.8.20
1.8.10
1.8.00
1.7.90
1.7.80
1.7.70
1.7.60
1.7.50
1.7.40
1.7.30
1.7.20
1.7.10
1.7.00
1.6.90
1.6.80
1.6.70
1.6.60
1.6.50
1.6.40
1.6.30
1.6.20
1.6.10
1.6.00
1.5.90
1.5.80
1.5.70
1.5.60
1.5.50
1.5.40
1.5.30
1.5.20
1.5.10
1.5.00
1.4.100
1.4.90
1.4.80
1.4.70
1.4.60
1.4.50
1.4.40
1.4.30
1.4.20
1.4.10
1.4.00
1.3.90
1.3.80
1.3.70
1.3.60
1.3.50
1.3.40
1.3.30
1.3.20
1.3.10
1.3.00
1.2.90
1.2.80
1.2.70
1.2.60
1.2.50
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.100
1.1.90
1.1.80
1.1.70
1.1.60
1.1.50
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50

Package Sidebar

Install

npm i @hawk-ui/modal

Weekly Downloads

56

Version

4.5.0

License

MIT

Unpacked Size

30.4 kB

Total Files

9

Last publish

Collaborators

  • saurabh2112