All Projects → viettranx → rn-circle-quick-actions

viettranx / rn-circle-quick-actions

Licence: MIT license
React Native library to display a modal popup quick actions menu

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to rn-circle-quick-actions

react-layer-stack
Layering system for React. Useful for popover/modals/tooltip/dnd application
Stars: ✭ 158 (+285.37%)
Mutual labels:  popup
PopItUp
a Popup system for iOS
Stars: ✭ 26 (-36.59%)
Mutual labels:  popup
nativescript-menu
A plugin that adds a pop-up menu to NativeScript
Stars: ✭ 17 (-58.54%)
Mutual labels:  popup
LSDialogViewController
Custom Dialog for iOS written in Swift
Stars: ✭ 74 (+80.49%)
Mutual labels:  popup
FindTheStupidWindow
Windows API hooking project to log all the windows / UIs with the exact timestamp when they are opened.
Stars: ✭ 13 (-68.29%)
Mutual labels:  popup
prophetjs
Vanilla JS library to display toast messages.
Stars: ✭ 31 (-24.39%)
Mutual labels:  popup
SHPopup
A lightweight library for popup view
Stars: ✭ 36 (-12.2%)
Mutual labels:  popup
eins-modal
Simple to use modal / alert / dialog / popup. Created with pure JS. No javascript knowledge required! Works on every browser and device! IE9
Stars: ✭ 30 (-26.83%)
Mutual labels:  popup
react-spring-bottom-sheet
Accessible ♿️, Delightful ✨, & Fast 🚀
Stars: ✭ 604 (+1373.17%)
Mutual labels:  popup
ToolTipPopupWordTV
ToolTipopupWordTV is an Open Source Android library that allows developers to easily open a popup with details by select a word from a textview.
Stars: ✭ 41 (+0%)
Mutual labels:  popup
vue-modal
Reusable Modal component, supports own custom HTML, text and classes.
Stars: ✭ 29 (-29.27%)
Mutual labels:  popup
vercel-toast
💬 Framework-agnostic vercel design's toast component (≈1KB Gzipped)
Stars: ✭ 67 (+63.41%)
Mutual labels:  popup
WechatPopupWindow
高仿微信聊天界面长按弹框样式
Stars: ✭ 71 (+73.17%)
Mutual labels:  popup
jpopup
Simple lightweight (<2kB) javascript popup modal plugin
Stars: ✭ 27 (-34.15%)
Mutual labels:  popup
Xamarin-Forms-Popup-Demo
Sample Xamarin Forms app for using Popups
Stars: ✭ 20 (-51.22%)
Mutual labels:  popup
flycheck-popup-tip
Display Flycheck error messages using popup.el
Stars: ✭ 30 (-26.83%)
Mutual labels:  popup
vue-modal
A customizable, stackable, and lightweight modal component for Vue.
Stars: ✭ 96 (+134.15%)
Mutual labels:  popup
Ambar-Xamarin
A macOS Menu Bar app built with Xamarin and C#
Stars: ✭ 63 (+53.66%)
Mutual labels:  popup
CoinHive
A nice friendly simple and easly customizable GUI for coinhives javascript miner to embed onto websites so users of your site can interact with features of the miner on every single page this javascript miner is to help those who have problems with advertisements/advertising/ads popups banners mobile redirects malvertising/malware etc and provid…
Stars: ✭ 58 (+41.46%)
Mutual labels:  popup
vue-dialog
A drag-able dialog for Vue.js
Stars: ✭ 21 (-48.78%)
Mutual labels:  popup

Circle Quick Actions

React Native library to display a modal popup quick actions menu by long press.

Demo

Installation

First, download the library from npm:

npm install rn-circle-quick-actions --save

Usage

import CircleQuickActions from 'rn-circle-quick-actions'

// Max items is 4
const items = [
  {
    image: require('some_image'),
    imageActive: require('some_image_activated'),
    handler: () => {
      alert('First action')
    }
  },
  {
    image: require('some_image'),
    imageActive: require('some_image_activated'),
    handler: () => {
      alert('Second action')
    }
  }
]

const QuickActionView () => (
  <CircleQuickActions
    onPress={() => alert('It is a normal press')}
    items={items}
  >
    <Image
      style={{ width: 320, height: 200 }}
      source={{ uri: 'YOUR_IMAGE_URL' }}
    />
  </CircleQuickActions>
);

Usage: With FlatList or scrollable view

We provided some lifecycle methods (shouldEnable, willOpen, didOpen, didClose) to enable more control your scroll view.

This is an example with Flatlist. We need to control scroll enabled to use pan gesture.

export default class App extends Component {

  setScrollEnabled = (isEnabled) => {
    if (this.list) {
      this.list.getScrollResponder().setNativeProps({ scrollEnabled: isEnabled })
    }
  }

  renderListItem = ({ item }) => {
    return (
      <CircleQuickAction
        onPress={() => alert('On press')}
        // shouldEnable={(e) => shouldEnable(e)}
        willOpen={() => this.setScrollEnabled(false)}
        // didOpen={() => onDidOpenMenu()}
        didClose={() => this.setScrollEnabled(true)}
        items={items}
      >
        <Image
          source={item.image}
          style={{ width: 320, height: 300 }}
        />
      </CircleQuickAction>
    )
  }

  render() {
    return (
      <View style={styles.container}>
        <FlatList
          ref={list => this.list = list}
          style={{ flex: 1 }}
          data={data}
          keyExtractor={(item) => item.id}
          renderItem={this.renderListItem}
        />
      </View>
    );
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].