1.0.8 • Published 3 years ago

@gladio/dialog v1.0.8

Weekly downloads
28
License
MIT
Repository
github
Last release
3 years ago

Dialog Component

Use dialog component to show ui element inside a dialog or popup

Install

npm install --save @gladio/dialog

Usage

import Dialog, { useDialog } from "@gladio/dialog"

function Continue({ onContinue }) {
  // helper react hook, (useState can also be used)
  const [isConfirmationVisible, showConfirm, hideConfirm] = useDialog()
  return (
    <div>
      <button onClick={showConfirm}>Continue</button>
      <Dialog open={isConfirmationVisible} onClose={hideConfirm} closeButton>
        <Dialog.Header>
          <Dialog.Title>Are you sure you want to continue ?</Dialog.Title>
        </Dialog.Header>
        <Dialog.Body>
          You will not be able to recover after this step!
        </Dialog.Body>
        <Dialog.Footer>
          <button
            onClick={() => {
              hideConfirm()
              onContinue()
            }}
          >
            Continue
          </button>{" "}
          <button onClick={hideConfirm}>Cancel</button>
        </Dialog.Footer>
      </Dialog>
    </div>
  )
}
1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.14.1

3 years ago

0.14.0

3 years ago

0.13.2

4 years ago

0.13.1

4 years ago

0.13.0

4 years ago