All Projects → ysfuu → react-native-relative-popup

ysfuu / react-native-relative-popup

Licence: MIT License
A popup component that sticks to an element and stays on top of everything.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-relative-popup

ng2-dialog-window
Modal/dialog windows and popups module for Angular applications.
Stars: ✭ 17 (+13.33%)
Mutual labels:  popup
neodigm55
An eclectic low-code vanilla JavaScript UX micro-library for those that defiantly think for themselves.
Stars: ✭ 14 (-6.67%)
Mutual labels:  popup
RDPopup
A simple way to add custom Popup. Design on Nib and use as you want. Written in Objective-C.
Stars: ✭ 19 (+26.67%)
Mutual labels:  popup
SimpleToast
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or MacOS applications in SwiftUI. Because of the flexibility to show any content it is also possible to use the library for showing simple modals.
Stars: ✭ 131 (+773.33%)
Mutual labels:  popup
Menu
The most customizable menu for macOS apps.
Stars: ✭ 84 (+460%)
Mutual labels:  popup
plain-modal
The simple library for customizable modal window.
Stars: ✭ 21 (+40%)
Mutual labels:  popup
Bonsai
🌲 Bonsai makes your view controller custom size.
Stars: ✭ 63 (+320%)
Mutual labels:  popup
mediawiki-extensions-Popups
GitHub mirror of MediaWiki extension Popups - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing
Stars: ✭ 37 (+146.67%)
Mutual labels:  popup
vim-hitspop
💬 Popup the number of search results
Stars: ✭ 38 (+153.33%)
Mutual labels:  popup
Popup-my-Bookmarks
A browser extension that providing a more efficient way to view and manage your bookmarks menu
Stars: ✭ 88 (+486.67%)
Mutual labels:  popup
react-native-popup
React Native Animated Popup Modal
Stars: ✭ 19 (+26.67%)
Mutual labels:  popup
customer-ajax-login
Free magento 2 extension for Popup and AJAX based Login and Sign Up | Manish Joy
Stars: ✭ 14 (-6.67%)
Mutual labels:  popup
react-apple-signin-auth
 Apple signin for React using the official Apple JS SDK
Stars: ✭ 58 (+286.67%)
Mutual labels:  popup
mac-ibm-notifications
macOS agent used to display custom notifications and alerts to the end user.
Stars: ✭ 206 (+1273.33%)
Mutual labels:  popup
SPStorkController
Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
Stars: ✭ 2,515 (+16666.67%)
Mutual labels:  popup
ArminC-uBlock-Settings
⚙️ ArminC's settings for uBlock₀ - remove most of the ads, pop-ups and trackers.
Stars: ✭ 24 (+60%)
Mutual labels:  popup
XPopupExt
XPopup扩展功能库,基于XPopup强大的弹窗能力和PickerView的选择器逻辑,封装了时间选择器弹窗、城市选择器弹窗和条件选择器。
Stars: ✭ 248 (+1553.33%)
Mutual labels:  popup
CustomPermissionsDialogue
Custom Permissions Dialogue is the only permissions library that supports ALL permission request scenarios. This library handles multiple edge cases such as not enabling all permissions or permanently rejecting a permission request.
Stars: ✭ 51 (+240%)
Mutual labels:  popup
sliding-pane
Pane that slides out of the window side
Stars: ✭ 120 (+700%)
Mutual labels:  popup
WeiboPopupMenu
模仿新浪微博菜单弹出界面(已停止维护)
Stars: ✭ 75 (+400%)
Mutual labels:  popup

react-native-relative-popup

A popup component that sticks to an element and stays on top of everything.

  • Span a popup to the app root using the amazing library @gorhom/portal
  • Popup position will be relative to its parent component's bounds and will try to stay in the viewport
  • Fully customizable content
  • Built with Typescript

Demo

Expo Snack @jotform/react-native-relative-popup

Relative Popup Demo

Usage

yarn add react-native-relative-popup

PopupProvider

Wrap your app with PopupProvider

import { PopupProvider } from 'react-native-relative-popup';

export default () => (
  <PopupProvider>
    {/* Rest of your app */}
    {/* Popups will be teleported to here */}
  </PopupProvider>
);

Popup

Create a popup

import Popup from 'react-native-relative-popup';

export default () => {
  const [open, setOpen] = useState(false);

  return (
    <TouchableOpacity onPress={() => setOpen(true)}>
      <Text>Button</Text>

      <Popup isOpen={open} onClose={() => setOpen(false)}>
        <Text>Popup Content</Text>
      </Popup>
    </TouchableOpacity>
  );
};
Prop Type Mandatory Default Value Description
isOpen boolean Yes false Should be popup shown?
children node or func Yes null Popup content. Can be a function which has popup position parameters
position 'top-left', 'top-right', 'top-center', 'bottom-left', 'bottom-right', 'bottom-center' No 'bottom-right' Position of the popup
horizontalSpacing number No 0 Horizontal spacing of the popup from the relative element
verticalSpacing number No 0 Vertical spacing of the popup from the relative element
safeAreaInsets EdgeInsets No 0 Safe area insets to use in positioning calculations.
onClose function No null A callback that fired when user presses outside of the popup

Usage

import React, { useState } from 'react';
import Popup from 'react-native-relative-popup';

export default () => {
  const [open, setOpen] = useState(false);

  return (
    <TouchableOpacity onPress={() => setOpen(true)}>
      <Text>Button</Text>

      <Popup isOpen={open} onClose={() => setOpen(false)}>
        <Text>Popup Content</Text>
      </Popup>
    </TouchableOpacity>
  );
};

Built With ❤️

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

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].