apeman-react-dialog

apeman react package for dialog component.

Usage no npm install needed!

<script type="module">
  import apemanReactDialog from 'https://cdn.skypack.dev/apeman-react-dialog';
</script>

README

apeman-react-dialog

Build Status Code Climate Code Coverage npm Version JS Standard

apeman react package for dialog component.

Installation

$ npm install apeman-react-dialog --save

Demo

Live demo is hosted on GitHub Pages.

Usage

'use strict'

import React from 'react'
import {
  ApDialog,
  ApDialogHeader,
  ApDialogBody,
  ApDialogStyle
} from 'apeman-react-dialog'

const ExampleComponent = React.createClass({
  getInitialState () {
    return {
      dialogEnabled: true
    }
  },
  render () {
    const s = this
    let state = s.state
    return (
      <div>
        <ApDialogStyle />
        <ApDialog enabled={state.dialogEnabled}
                  onClose={() =>{s.toggleDialog(false)} }>
          <ApDialogHeader>Dialog Header</ApDialogHeader>
          <ApDialogBody>Dialog Body</ApDialogBody>
        </ApDialog>
      </div>
    )
  },
  toggleDialog (enabled) {
    const s = this
    s.setState({
      dialogEnabled: enabled
    })
  }
})

Components

ApConfirmDialogStyle

Props

Name Type Default Description

ApConfirmDialog

Props

Name Type Default Description
present bool
onSubmit func null
onCancel func null
title string
message string 'Once destroyed, there is no going back. Please be certain.'
checkboxId string `ap-confirm-dialog-checkbox-${id}`
checkboxName string `ap-confirm-check-${id}`
checkboxText string null
errorText string 'Needs check before submit.'
submitText string 'submit'

ApDialogBody

Props

Name Type Default Description

ApDialogHeader

Props

Name Type Default Description

ApDialogStyle

Props

Name Type Default Description

ApDialog

Props

Name Type Default Description
present bool false
onClose func null
spinning bool false
spinner string ApSpinner.DEFAULT_THEME
title string null
closeIcon string 'fa fa-close'

ApYesnoDialogStyle

Props

Name Type Default Description

ApYesnoDialog

Props

Name Type Default Description

License

This software is released under the MIT License.

Links