Modern Cross-platform ActionSheet For React Native

Author: aelesia
Views Total: 0 views
Official Page: Go to website
Publish Date: June 29, 2020
License: MIT

A simple yet modern and cross-platform ActionSheet component using the native Android ActionSheets and ActionSheetIOS.

How to use it:

1. Install the package.

# Yarn
$ yarn add react-native-cross-actionsheet

# NPM
$ npm react-native-cross-actionsheet --save

2. Import the ‘ActionSheet’ module.

import { ActionSheet } from 'react-native-cross-actionsheet'

3. Add items to the ActionSheet.

ActionSheet.options({
  title: 'Reactscript ActionSheet',
  message: 'Select An option',
  options: [
    { text: 'Create', onPress: () => console.log('create'), },
    { text: 'Update', onPress: () => console.log('update') },
    { text: 'Delete', onPress: () => console.log('delete'), destructive: true }
  ],
  cancel: { text: 'Cancel', onPress: () => console.log('cancel') },
  tintColor: '#008888',
  anchor: 'iOS ONLY'
})

Preview:

Modern Cross-platform ActionSheet For React Native

You Might Be Interested In:

Leave a Reply