0.0.11 • Published 6 years ago

react-native-actually-usable-prompt v0.0.11

Weekly downloads
41
License
-
Repository
github
Last release
6 years ago

react-native-actually-usable-prompt

Installation

yarn add react-native-actually-usable-prompt

Definition

Available here.

Usage

import Prompt from 'react-native-actually-usable-prompt';

<Prompt ref={ref => (this.p = ref)} />;

// then run
this.p.prompt('Trololo?', answer => console.log(answer), {
  // optional, see types for a list of available options
  subtitle: 'BOPadududu-dah-da-du-daaaah!',

  // typical TextInput props ..
  autoFocus: true,
  clearButtonMode: 'always',
  placeholder: 'Type here ..',
  underlineColorAndroid: 'transparent',
  defaultValue: 'Ya ya yaaaah'

  // you can also pass these to <Prompt /> directly through a global config prop
});

// to show confirmation instead of input
this.p.confirm('Trololo!?', yes => console.log(yes), {
  // optional, see types for a list of available options
  subtitle: 'BOPadududu-dah-da-du-daaaah!'
});

// to show an alert
this.p.alert('Trololo!', {
  // optional, see types for a list of available options
  subtitle: 'BOPadududu-dah-da-du-daaaah!'
});

// to show a select dialog
this.p.select(
  'Trololo?',
  ['Ya ya yaaaah', 'Huh?'],
  (index, value) => console.log(index, value),
  {
    // optional, see types for a list of available options
    subtitle: 'BOPadududu-dah-da-du-daaaah!'
  }
);

// <Prompt /> should be placed at the end of your UI to have a higher zIndex value
// or manipulate directly through overlayStyle prop

// e.g.

<Container>
  <UI />
  <Prompt />
</Container>;

Example

Available here.

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago