0.1.8 • Published 6 years ago

modalian v0.1.8

Weekly downloads
26
License
MIT
Repository
github
Last release
6 years ago

Modalian

Modalian is a simple react modal component. You can visit online Demo

Install

Install with npm or Yarn:

npm:

npm install modalian --save

Yarn :

yarn add modalian

Usage

import Modalian, { Confirm } from 'modalian';

<Modalian
  visible={this.state.modalVisible}
  onClose={this.toggleModal}
  title='Invite developers to use Modalian'
  okBtnText='Invite'
  onOk={() => { console.log('click on OK'); }}
  onCancel={() => { console.log('click on Cancel'); this.toggleModal(); }}
>
  <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
</Modalian>

<Confirm
  visible={this.state.confirmVisible}
  onClose={this.toggleConfirm}
  confirmBtnText='Confirm'
  onConfirm={() => { console.log('click on Confirm'); }}
  onCancel={() => { console.log('click on Cancel'); this.toggleConfirm(); }}
  title='Are you sure about it?'
  description='you cant undo this action'
/>

Modalian options:

PropertyDescriptionTypeDefault
visibleshow or hide modalboolean-
onClosecalles when a user clicks close iconfunction-
onOkcalles when a user clicks OK buttonfunction-
onCancelcalles when a user clicks Cancel buttonfunction-
titlemakes header for modal and show title therestring-
footerset null/false if you don't need default footerbooleantrue
okBtnTextspecify text of OK buttonstringOk
cancelBtnTextspecify text of Cancel buttonstringCancel
closablespecify modal has close icon or notbooleantrue
closableMaskspecify when user clicks on mask modal will closebooleantrue
rtlmakes modal right to leftbooleanfalse

Confirm options:

PropertyDescriptionTypeDefault
visibleshow or hide confirmboolean-
onClosecalles when a user clicks close iconfunction-
onConfirmcalles when a user clicks Confirm buttonfunction-
onCancelcalles when a user clicks Cancel buttonfunction-
titledefines title of confirm boxstring-
descriptiondefines title of confirm boxstring-
confirmBtnTextspecify text of Confirm buttonstringOk
cancelBtnTextspecify text of Cancel buttonstringCancel
rtlmakes confirm modal right to leftbooleanfalse

Lunch demo as indepented project

  1. git clone https://github.com/arashmanteghi/modalian.git
  2. Run npm install
  3. Start the dev-server using npm start
  4. Open http://localhost:3000

Commands

  • npm start - start the dev-server
  • npm run dist - build as production

Licence

Modalian is available under MIT licence.

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.0

6 years ago