@crpt/react-dialog

react-tooltip React component

Usage no npm install needed!

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

README

react-tabs

Travis npm package Coveralls

Dialog component.

Usage


import { Dialog } from  "@crpt/react-dialog";


<Dialog
  isOpen={true}
  title={'Изменение настроек'}
  content={<div>Вы изменили настройки учетной записи.<br/>
    Вы уверены, что хотите не сохранять их?</div>}
  onOverlayClick={e => console.log('Overlay clicked, now close')}
  buttons={[
    {
      children: 'Отменить изменения',
      onClick: e => console.log('Отменить изменения')
    },
    {
      children: 'Сохранить изменения',
      onClick: e => console.log('Сохранить изменения')
    }
  ]}
/>
PropName Description Example
isOpen: Boolean(required) Dialog open if true.
title: String or Element Title of dialog. <Dialog title={Hello} />
content: String or Element content of dialog. <Dialog content={Hello, i am dialog.} />
onOverlayClick: Function On overlay click handler. <Dialog onOverlayClick={e => console.log('Overlay clicked, now close')} />
buttons: Array(required) Array of button props. <Dialog buttons={[
{
children: 'Отменить изменения',
onClick: e => console.log('Отменить изменения')
},
{
children: 'Сохранить изменения',
onClick: e => console.log('Сохранить изменения')
}
]} />