1.0.12 • Published 3 years ago

native-x-modal v1.0.12

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

native-x-modal

semantic-release

This component adds space between to other components

Install

Yarn

yarn add native-x-modal

NPM

npm install native-x-modal

Usage

import { Modal } from 'native-x-modal'

function MyComponent() {
  const [visible, setVisible] = React.useState(false)
  return (
    <Modal visible={visible} onClose={() => setVisible(false)}>
      ...
    </Modal>
  )
}

API

PropertyDefault ValueUsage
children?: stringContent
visible?: booleanShow modal
showClose?: booleanShow close button
width?: numberWidth of the modal
onClose?: () => voidOn close modal

Confirmation Modal

import { ConfirmationModal } from 'native-x-modal'

function MyComponent() {
  const [visible, setVisible] = React.useState(false)
  return (
    <ConfirmationModal
      visible={visible}
      onOk={onOkFn}
      onCancel={onCancelFn}
      okText='OK'
      cancelText='Cancel'
      onClose={() => setVisible(false)}>
      ...
    </Modal>
  )
}
PropertyDefault ValueUsage
children?: stringContent
visible?: booleanShow modal
showClose?: booleanShow close button
width?: numberWidth of the modal
onClose?: () => voidOn close modal
onOk?: () => voidOn click on ok button
onCancel?: () => voidOn click on cancel button
okText?: stringOKLabel of ok button
okButtonBackgroundColor?: stringBackground color of ok button
okTextColor?: stringText color of ok button
cancelText?: stringCancelLabel of cancel button
cancelButtonBackgroundColor?: stringBackground color of cancel button
cancelTextColor?: stringText color of cancel button

Automatic Release

Here is an example of the release type that will be done based on a commit messages:

Commit messageRelease type
fix: commentPatch Release
feat: commentMinor Feature Release
perf: commentMajor Feature Release
doc: commentNo Release
refactor: commentNo Release
chore: commentNo Release