All Projects → atlj → react-native-lightning-modal

atlj / react-native-lightning-modal

Licence: MIT license
A performant bottom modal that works using React Native Reanimated 2

Programming Languages

typescript
32286 projects
java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language
c
50402 projects - #5 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to react-native-lightning-modal

Ngx Smart Modal
Modal/Dialog component crafted for Angular
Stars: ✭ 256 (+1180%)
Mutual labels:  modal, npm-package
php-json-fixer
Fix truncated JSON data
Stars: ✭ 37 (+85%)
Mutual labels:  hacktoberfest2021
HacktoSearch
Helping you find the best contributions you can make in Hacktoberfest 2021!
Stars: ✭ 17 (-15%)
Mutual labels:  hacktoberfest2021
opensource
Site de Open Source da CodeMiner42
Stars: ✭ 25 (+25%)
Mutual labels:  hacktoberfest2021
HacktoberFest21
A beginner friendly repository for HacktoberFest 2021
Stars: ✭ 45 (+125%)
Mutual labels:  hacktoberfest2021
HacktoberFest-2021
A repository for Hacktober Fest contributions. Everyone is welcome. Fork away!
Stars: ✭ 10 (-50%)
Mutual labels:  hacktoberfest2021
frontatish
A React native common components kit and helper methods,find the package at this link https://www.npmjs.com/package/frontatish
Stars: ✭ 14 (-30%)
Mutual labels:  npm-package
PortfolioV2
🔥 The Complete Customizable Software Developer Portfolio Template which lets you showcase your work and provides each and every detail about you as Software Developer.
Stars: ✭ 197 (+885%)
Mutual labels:  hacktoberfest2021
retryx
Promise-based retry workflow library.
Stars: ✭ 21 (+5%)
Mutual labels:  npm-package
College-Notes
Contribute your handwritten PDF notes and help other students ✌ #DecodersCommunity 🖤
Stars: ✭ 30 (+50%)
Mutual labels:  hacktoberfest2021
example-typescript-package
Example TypeScript Package ready to be published on npm & Tutorial / Instruction / Workflow for 2021
Stars: ✭ 71 (+255%)
Mutual labels:  npm-package
macropower-analytics-panel
It's like Google Analytics, but for Grafana dashboards!
Stars: ✭ 16 (-20%)
Mutual labels:  hacktoberfest2021
imrc-datetime-picker
(Improved) React component datetime picker by momentjs 📆
Stars: ✭ 21 (+5%)
Mutual labels:  npm-package
open-climate-investing
Application and data for analyzing and structuring portfolios for climate investing.
Stars: ✭ 20 (+0%)
Mutual labels:  hacktoberfest2021
windows-network-drive
Do network drive stuff on Microsoft Window in node
Stars: ✭ 18 (-10%)
Mutual labels:  npm-package
VSCode-Bedrock-Development-Extension
An extension that provides support for files such as: .mcfunction, .json and .lang. Features include: completion, validations, formatters, diagnostics, cheat-sheets, code-actions, generation of files, and development tools to help develop Minecraft Bedrock Addons or Minecraft Education Edition.
Stars: ✭ 45 (+125%)
Mutual labels:  hacktoberfest2021
HacktoberFest2021
No description or website provided.
Stars: ✭ 33 (+65%)
Mutual labels:  hacktoberfest2021
LatexJekyll
A latex document style website
Stars: ✭ 80 (+300%)
Mutual labels:  hacktoberfest2021
semantic-release
📦🚀 Fully automated version management and package publishing
Stars: ✭ 29 (+45%)
Mutual labels:  hacktoberfest2021
js-module-system
A small UI library to demonstrate the JS module system
Stars: ✭ 36 (+80%)
Mutual labels:  npm-package

react-native-lightning-modal

2021-08-09 17-32-38

A fast bottom modal that works with React Native Reanimated 2!

Prerequisites

This module needs

React Native Reanimated 2 &

React Native Gesture Handler to work

🚀 Installation

First make sure that you have installed all the prerequisites.

Using npm

npm install react-native-lightning-modal

Using Yarn

yarn add react-native-lightning-modal

⚙️ Usage

Using the useBottomModal hook 🪝

This hook declares the ref for you

import React from 'react';

import { View } from 'react-native';

import { useBottomModal, BottomModal } from 'react-native-lightning-modal';

export default function App() {
  const { dismiss, show, modalProps } = useBottomModal();

  return (
    <View>
      <BottomModal height={500} {...modalProps}>
        {/* Your Content */}
      </BottomModal>
    </View>
  );
}

Bottom modal component needs to be below other elements.

You can then use

show();

to show the modal


Using a ref 📝

import React from 'react';

import { View } from 'react-native';

import { BottomModal, BottomModalRef } from 'react-native-lightning-modal';

export default function App() {
  const bottomModalRef = React.useRef < BottomModalRef > null;

  return (
    <View>
      <BottomModal height={500} ref={bottomModalRef}>
        {/* Your Content */}
      </BottomModal>
    </View>
  );
}

You can than use

bottomModalRef.show();

to show the modal

DOCUMENTATION

PROPS

Prop Name Description Type Required Defaults to
height Height of modal's presented state. This is required for animation to behave correctly number
backdropColor Basically the color of a fullscreen view displayed below modaL string undefined
style Style of modal's container ViewStyle undefined
animation Animation type to use, can get spring and timing, defaults to timing animation 'spring' | 'timing' 'timing'
timingConfig Timing animation's config if animation prop is set to 'timing' Animated.WithTimingConfig {duration: 300, easing: Easing.quad}
springConfig Spring animation's config if animation prop is set to 'spring' Animated.WithSpringConfig undefined
backdropStyle Style of the backdrop component ViewStyle undefined

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