GithubHelp home page GithubHelp logo

martinredbullet / react-native-action-sheet-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ristobin/react-native-action-sheet

0.0 1.0 0.0 294 KB

License: MIT License

Java 45.94% JavaScript 10.13% Objective-C 34.56% Ruby 3.91% Starlark 5.47%

react-native-action-sheet-1's Introduction

react-native-action-sheet

React native action sheet with native iOS and android (using the built-in AlertDialog for android, UIAlertController for iOS)

This component is a actionsheet component so that user can set "Disabled" button to ActionSheet. (iOS & Android)

Usage

iOS Android
import ActionSheet from 'react-native-action-sheet';
import { Platform } from 'react-native';

var BUTTONS = [
    { name: 'Option 0', disabled: true },
    { name: 'Option 1' },
    { name: 'Option 2', disabled: true },
    { name: 'Option 3' },
    { name: 'Cancel' }
];

var DESTRUCTIVE_INDEX = 3;
var CANCEL_INDEX = 4;

ActionSheet.showActionSheetWithOptions({
  options: BUTTONS,
  cancelButtonIndex: CANCEL_INDEX,
  destructiveButtonIndex: DESTRUCTIVE_INDEX,
  tintColor: 'blue',
  title: "Hello",
  message: "This component is ActionSheet with disabled button."
},
(buttonIndex) => {
  console.log('button clicked :', buttonIndex);
});

Methods

For the iOS implementation see ActionSheetIOS

options

option iOS Android Info
options OK OK (array of strings) - a list of button titles (required on iOS)
cancelButtonIndex OK - (int) - index of cancel button in options (useless in android since we have back button)
destructiveButtonIndex OK - (int) - index of destructive button in options (same as above)
title OK OK (string) - a title to show above the action sheet
message OK - (string) - a message to show below the title
tintColor OK - (string) - a color to set to the text (defined by processColor)

Author

Risto Binovski

react-native-action-sheet-1's People

Contributors

ristobin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.