npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-material-dialog

v0.7.7

Published

Material design compliant dialog for React Native

Downloads

1,921

Readme

npm version License: MIT npm downloads

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

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.

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

| Name | Description | Default/Required | Type | | --------------- | ------------------------------------------------------------------ | --------------------- | ------- | | visible | shows or hides the dialog | required | bool | | children | element to be rendered in the content of the dialog | required | element | | onCancel | callback when the dialog is closed or the cancel action is pressed | required | func | | onOk | callback when the ok action is pressed | undefined | func | | cancelLabel | label for the cancel action | 'CANCEL' | string | | okLabel | label for the ok action | 'OK' | string | | title | text for the dialog title | undefined | string | | titleColor | color of the dialog title | 'rgba(0, 0, 0, 0.87)' | string | | backgroundColor | color of the dialog background | '#FFFFFF' | string | | colorAccent | color of the action text | '#51BC78' | string | | scrolled | whether the form is in scrolled mode | false | bool | | addPadding | automatically add paddings to the content | true | bool |

SinglePickerMaterialDialog

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

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

| Name | Description | Default/Required | Type | | --------------- | ------------------------------------------------------------------ | --------------------- | ---------------------------------------------------- | | visible | shows or hides the dialog | required | bool | | items | list of options to choose from | required | array of objects with a 'label' and 'value' property | | selectedItem | item that will be selected when opening the dialog | required | object with a 'label' and 'value' property | | onCancel | callback when the dialog is closed or the cancel action is pressed | required | func | | onOk | callback when the ok action is pressed | undefined | func | | cancelLabel | label for the cancel action | 'CANCEL' | string | | okLabel | label for the ok action | 'OK' | string | | title | text for the dialog title | undefined | string | | titleColor | color of the dialog title | 'rgba(0, 0, 0, 0.87)' | string | | backgroundColor | color of the dialog background | '#FFFFFF' | string | | colorAccent | color of the action text | '#51BC78' | string | | scrolled | whether the form is in scrolled mode | false | bool |

MultiPickerMaterialDialog

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

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

| Name | Description | Default/Required | Type | | --------------- | ------------------------------------------------------------------ | --------------------- | ---------------------------------------------------- | | visible | shows or hides the dialog | required | bool | | items | list of options to choose from | required | array of objects with a 'label' and 'value' property | | selectedItems | items that will be selected when opening the dialog | required | array of objects with a 'label' and 'value' property | | onCancel | callback when the dialog is closed or the cancel action is pressed | required | func | | onOk | callback when the ok action is pressed | undefined | func | | cancelLabel | label for the cancel action | 'CANCEL' | string | | okLabel | label for the ok action | 'OK' | string | | title | text for the dialog title | undefined | string | | titleColor | color of the dialog title | 'rgba(0, 0, 0, 0.87)' | string | | backgroundColor | color of the dialog background | '#FFFFFF' | string | | colorAccent | color of the action text | '#51BC78' | string | | scrolled | whether the form is in scrolled mode | false | bool |

References

  • https://material.io/guidelines/components/dialogs.html

License

Contact

Tweet me @hectahertz