New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-material-dialog

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-material-dialog

Material design compliant dialog for React Native

  • 0.7.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Native Material Dialog

npm version License: MIT npm downloads

Material design dialog components for React Native. JavaScript-only, for iOS and Android.

React Native Material Dialog iOS Showcase React Native Material Dialog Android Showcase

Getting started

Step 1

If you're not using Expo, install react-native-vector-icons

Step 2

Install react-native-material-dialog

npm install react-native-material-dialog --save

Example

Included components

Roadmap

  • Support for stacked action buttons.
  • Dialog that holds a slider.
  • Simple dialog component that accepts a string as content and styles it.

MaterialDialog

Basic and customizable dialog that can hold any component.

Material Design Collection
import { MaterialDialog } from 'react-native-material-dialog';

<MaterialDialog
  title="Use Google's Location Service?"
  visible={this.state.visible}
  onOk={() => this.setState({ visible: false })}
  onCancel={() => this.setState({ visible: false })}>
  <Text style={styles.dialogText}>
    Let Google help apps determine location. This means sending anonymous
    location data to Google, even when no apps are running.
  </Text>
</MaterialDialog>;

Props

NameDescriptionDefault/RequiredType
visibleshows or hides the dialogrequiredbool
childrenelement to be rendered in the content of the dialogrequiredelement
onCancelcallback when the dialog is closed or the cancel action is pressedrequiredfunc
onOkcallback when the ok action is pressedundefinedfunc
cancelLabellabel for the cancel action'CANCEL'string
okLabellabel for the ok action'OK'string
titletext for the dialog titleundefinedstring
titleColorcolor of the dialog title'rgba(0, 0, 0, 0.87)'string
backgroundColorcolor of the dialog background'#FFFFFF'string
colorAccentcolor of the action text'#51BC78'string
scrolledwhether the form is in scrolled modefalsebool
addPaddingautomatically add paddings to the contenttruebool

SinglePickerMaterialDialog

Ready to use dialog that allows to choose only one option from a list.

Material Design Collection
import { SinglePickerMaterialDialog } from 'react-native-material-dialog';

<SinglePickerMaterialDialog
  title={'Pick one element!'}
  items={LIST.map((row, index) => ({ value: index, label: row }))}
  visible={this.state.singlePickerVisible}
  selectedItem={this.state.singlePickerSelectedItem}
  onCancel={() => this.setState({ singlePickerVisible: false })}
  onOk={result => {
    this.setState({ singlePickerVisible: false });
    this.setState({ singlePickerSelectedItem: result.selectedItem });
  }}
/>;

Props

NameDescriptionDefault/RequiredType
visibleshows or hides the dialogrequiredbool
itemslist of options to choose fromrequiredarray of objects with a 'label' and 'value' property
selectedItemitem that will be selected when opening the dialogrequiredobject with a 'label' and 'value' property
onCancelcallback when the dialog is closed or the cancel action is pressedrequiredfunc
onOkcallback when the ok action is pressedundefinedfunc
cancelLabellabel for the cancel action'CANCEL'string
okLabellabel for the ok action'OK'string
titletext for the dialog titleundefinedstring
titleColorcolor of the dialog title'rgba(0, 0, 0, 0.87)'string
backgroundColorcolor of the dialog background'#FFFFFF'string
colorAccentcolor of the action text'#51BC78'string
scrolledwhether the form is in scrolled modefalsebool

MultiPickerMaterialDialog

Ready to use dialog that allows to choose several options from a list.

Material Design Collection
import { MultiPickerMaterialDialog } from 'react-native-material-dialog';

<MultiPickerMaterialDialog
  title={'Pick some elements!'}
  colorAccent={this.props.colorAccent}
  items={LIST.map((row, index) => {
    return { value: index, label: row };
  })}
  visible={this.state.multiPickerVisible}
  selectedItems={this.state.multiPickerSelectedItems}
  onCancel={() => this.setState({ multiPickerVisible: false })}
  onOk={result => {
    this.setState({ multiPickerVisible: false });
    this.setState({ multiPickerSelectedItems: result.selectedItems });
  }}
/>;

Props

NameDescriptionDefault/RequiredType
visibleshows or hides the dialogrequiredbool
itemslist of options to choose fromrequiredarray of objects with a 'label' and 'value' property
selectedItemsitems that will be selected when opening the dialogrequiredarray of objects with a 'label' and 'value' property
onCancelcallback when the dialog is closed or the cancel action is pressedrequiredfunc
onOkcallback when the ok action is pressedundefinedfunc
cancelLabellabel for the cancel action'CANCEL'string
okLabellabel for the ok action'OK'string
titletext for the dialog titleundefinedstring
titleColorcolor of the dialog title'rgba(0, 0, 0, 0.87)'string
backgroundColorcolor of the dialog background'#FFFFFF'string
colorAccentcolor of the action text'#51BC78'string
scrolledwhether the form is in scrolled modefalsebool

References

License

Contact

Tweet me @hectahertz

Keywords

FAQs

Package last updated on 26 Nov 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc