Socket
Socket
Sign inDemoInstall

react-native-dialog-input-custom

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-dialog-input-custom

React native dialog input customizable


Version published
Weekly downloads
4
Maintainers
1
Install size
24.7 kB
Created
Weekly downloads
 

Readme

Source

react-native-dialog-input-custom

This is a dialog input for react native, it's really customizable. It works fine in Android and iOS.

Setup

npm install --save react-native-dialog-input

Basic Usage


import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import DialogInput from 'react-native-dialog-input-custom';



export default class App extends Component<> {
  constructor(props){
    super(props);
    this.state = {
      dialogIsVisible: true
    }
  }
  render() {
    return (
      <View style={styles.container}>
        <DialogInput 
        dialogIsVisible={this.state.dialogIsVisible}
        closeDialogInput={() => this.setState({dialogIsVisible: false})}
        submitInput={(textValue) => console.warn(textValue)}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
});

Example (Basic)

React Native Dialog Input iOS React Native Dialog Input Android

Custom Usage



import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View } from 'react-native';
import DialogInput from 'react-native-dialog-input-custom';



export default class App extends Component<> {
  constructor(props) {
    super(props);
    this.state = {
      dialogIsVisible: true
    }
  }
  render() {
    return (
      <View style={styles.container}>
        <DialogInput
          dialogIsVisible={this.state.dialogIsVisible}
          closeDialogInput={() => this.setState({ dialogIsVisible: false })}
          submitInput={(textValue) => console.warn(textValue)}
          outerContainerStyle={{ backgroundColor: 'rgba(0,0,0, 0.75)' }}
          containerStyle={{ backgroundColor: 'rgba(255,0,0, 0.2)', borderColor: 'red', borderWidth: 5 }}
          titleStyle={{ color: 'white' }}
          title="This is the title"
          subTitleStyle={{ color: 'white' }}
          subtitle="This is the subtitle"
          placeholderInput="This is the text inside placeholder..."
          placeholderTextColor="black"
          textInputStyle={{ borderColor: 'black', borderWidth: 2 }}
          secureTextEntry={false}
          buttonsStyle={{ borderColor: 'white' }}
          textCancelStyle={{ color: 'white' }}
          submitTextStyle={{ color: 'white', fontStyle: 'italic' }}
          cancelButtonText="CANCEL"
          submitButtonText="CONFIRM"
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
});


Example (Custom)

React Native Dialog Input iOS React Native Dialog Input Android

Properties

namedescriptiontype
dialogIsVisibleValue to show the dialogBoolean
outerContainerStyleStyle for the background of the componentObject (OPTIONAL)
containerStyleStyle for the container of the componentObject (OPTIONAL)
titleStyleStyle for the titleObject (OPTIONAL)
titleValue of the titleString (OPTIONAL)
subTitleStyleValue of the subtitleString (OPTIONAL)
placeholderInputValue of the placeholderString (OPTIONAL)
placeholderTextColorColor of the placeholderString (OPTIONAL)
textInputStyleStyle for the TextInput componentObject (OPTIONAL)
secureTextEntryValue for the secure text propertyBoolean (OPTIONAL), default FALSE
buttonsStyleStyle for the two buttonsObject (OPTIONAL)
textCancelStyleStyle for the "Cancel" ButtonObject (OPTIONAL)
submitTextStyleStyle for the "Submit" ButtonObject (OPTIONAL)
cancelButtonTextValue of the "Cancel" ButtonString (OPTIONAL)
submitButtonTextValue of the "Submit" ButtonString (OPTIONAL)

Methods

namedescriptionreturns
closeDialogInput()Event fired when the user press the Cancel Button and Submit Button, used to close the dialog-
submitInput()Event fired when the user press the Submit button, it will also invoke closeDialogInput(), and returns the value of the text inputString

Keywords

FAQs

Last updated on 01 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc