1.0.3 • Published 2 years ago

rn-customizable-dialog v1.0.3

Weekly downloads
2
License
MIT
Repository
-
Last release
2 years ago

rn-customizable-dialog

Simple and customisable dialog box component for react native which can be used for activity indicator, alert or any other kind of dialog.

SetUp

npm i rn-customizable-dialog

Usages

import { CustomDialog } from 'rn-customizable-dialog';

<CustomDialog title='TITLE' message='Message' loading={this.state.loading} action_required={this.state.action_required} visible={this.state.visible} onPress={()=> this.setState({ visible: false })} onConfirm={() => this.onConfirmPressed()} buttonPositiveTitle='OK' buttonNegativeTitle='ABORT' titleTextStyle={{ fontSize: 14, color: 'white' }} buttonStyle={styles.buttonStyle} buttonTextStyle={styles.buttonText} bodyTextStyle={styles.dialogBodyText} singleButtonTitle='OK' />`

Screenshots

ScreenShot

ScreenShot

Properties

PropTypedefaultRequiredNote
visiblebooleanNARequiredset to true to make the dialog visible
titlestringNAOptionaltitle of the dialog
messagestringNAOptionalcontent of the dialog
action_requiredbooleanNAOptionalWhen more than one button is required and any action to be performed by clicking the dialog box set this to true
onPressfunctionNARequiredTo perform task on press of the single button or negative button
onConfirmfunctionNAOptionalPerform task onclick the positive button, use when action_required is true
buttonPositiveTitlestringNAOptionalUse when action_required is true
buttonNegativeTitlestringNAOptionalUse when action_required is true
titleTextStyleobjectNAOptionalSee example
buttonStyleobjectNARequiredSee example
buttonTextStyleobjectNAOptionalSee example
bodyTextStyleobjectNAOptionalSee example
singleButtonTitleobjectNAOptionalSee example, use when action_required is false