Dialog

Dialogs inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks.

Usage

export default class MyComponent extends React.Component {
  state = {
    visible: false,
  };

  _showDialog = () => this.setState({ visble: true });
  _hideDialog = () => this.setState({ visble: false });

  render() {
    const { visible } = this.state;
    return (
      <View>
        <Button onPress={this._showDialog}>Show Dialog</Button>
        <Dialog
           visible={visible}
           onRequestClose={this._hideDialog}
        >
          <DialogTitle>Alert</DialogTitle>
          <DialogContent>
            <Paragraph>This is simple dialog</Paragraph>
          </DialogContent>
          <DialogActions>
            <Button onPress={this._hideDialog}>Done</Button>
          </DialogActions>
        </Dialog>
      </View>
    );
  }
}

Props

dismissable
Type: boolean
Default value: true

Determines whether clicking outside the dialog dismiss it.

onRequestClose (required)
Type: Function

Callback that is called when the user dismisses the dialog.

visible (required)
Type: boolean
Default value: false

Determines Whether the dialog is visible.

children (required)

Content of the Dialog.

style
Type: any
theme
Type: Theme