All Projects → marcosmartinez7 → react-native-bottom-up-panel

marcosmartinez7 / react-native-bottom-up-panel

Licence: other
React Native drawer like panel

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-bottom-up-panel

Kf drawer
Flutter drawer (dynamic ready side menu)
Stars: ✭ 144 (+260%)
Mutual labels:  drawer
Material Menu
Animations for Android L drawer, back, dismiss and check icons
Stars: ✭ 2,481 (+6102.5%)
Mutual labels:  drawer
vue-modal
A customizable, stackable, and lightweight modal component for Vue.
Stars: ✭ 96 (+140%)
Mutual labels:  drawer
Smartswipe
An android library to make swipe more easier and more powerful. Android各种侧滑,有这一个就够了
Stars: ✭ 1,911 (+4677.5%)
Mutual labels:  drawer
Hyperion Ios
In-app design review tool to inspect measurements, attributes, and animations.
Stars: ✭ 1,964 (+4810%)
Mutual labels:  drawer
Drawerview
A drop-in view, to be used as a drawer anywhere in your app
Stars: ✭ 251 (+527.5%)
Mutual labels:  drawer
Zimlx
Open Source and free launcher for Android
Stars: ✭ 137 (+242.5%)
Mutual labels:  drawer
flutter advanced drawer
https://pub.dev/packages/flutter_advanced_drawer
Stars: ✭ 44 (+10%)
Mutual labels:  drawer
Mmenu Js
The best javascript plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.
Stars: ✭ 2,535 (+6237.5%)
Mutual labels:  drawer
Flutter slider drawer
You can make slider drawer type ui by this plugin
Stars: ✭ 152 (+280%)
Mutual labels:  drawer
Drawers
Group related classes together. No more silos. A solution to rails dystopia.
Stars: ✭ 150 (+275%)
Mutual labels:  drawer
Pulley
A library to imitate the iOS 10 Maps UI.
Stars: ✭ 1,928 (+4720%)
Mutual labels:  drawer
UX-UI-Navigation
UX / UI Custom NavigationDrawer with Fragment
Stars: ✭ 70 (+75%)
Mutual labels:  drawer
Materialdrawer
The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
Stars: ✭ 11,498 (+28645%)
Mutual labels:  drawer
DKNavigationDrawer
Navigation Drawer for iOS using Swift. https://media.giphy.com/media/I45syjhreC0Rq/giphy.gif
Stars: ✭ 17 (-57.5%)
Mutual labels:  drawer
React Native Drawer Menu
A drawer component for React Native Application.
Stars: ✭ 140 (+250%)
Mutual labels:  drawer
Swiftui Animation
SwiftUI Animation
Stars: ✭ 233 (+482.5%)
Mutual labels:  drawer
vue-simple-drawer
A tiny Drawer component with bounced animation for Vue 🚪🎏🗄🔛
Stars: ✭ 58 (+45%)
Mutual labels:  drawer
hipsbarjs
Hipsbarjs is a javascript plugin for easily creating drawers in web apps
Stars: ✭ 17 (-57.5%)
Mutual labels:  drawer
react-spring-bottom-sheet
Accessible ♿️, Delightful ✨, & Fast 🚀
Stars: ✭ 604 (+1410%)
Mutual labels:  drawer

React Native bottom up panel

Demo

Alt Text

Description

This component is a dynamic height and position view. It has a startHeight property that determines the section of the view that will be showed (generally the toggle button or header).

The component has a view with absolute positioning, the position and height of the view is handled by React Native Animations, using linear interpolation between the start and end position defined.

  • The component has two main parts:

    • header: a transparent view with height = startHeight and an Icon that will be rotated 180 degrees every time that the panel open/close
    • content: a transparent view to put the content.
  • Why are both components transparent? Because there are scenarios when you want to show the background of the main view with some opacity. So you have to set the right background for your content and header components.

  • Why there is no zIndex handling? Because the height of the view is dynamic, it starts from the bottom and then covers to topEnd property, so the view only covers the part that is visible.

Usage

Just add the index.js file wherever you want in your project and import it from your component

import React, {Component} from 'react';
import { Dimensions, FlatList,  Text, View } from 'react-native';
import {Ionicons} from '@expo/vector-icons'; 
import BottomUpPanel from "path/to/index.js";

const {height} = Dimensions.get('window');
const DATA= ["Some component","Some component","Some component","Some component","Some component","Some component","Some component","Some component","Some component","Some component","Some component","Some component","Some component","Some component","Some component","Some component"];

class SomeComponent extends Component {

   render = () =>
       <BottomUpPanel
                      content={this.renderBottomUpPanelContent}
                      icon={this.renderBottomUpPanelIcon}
                      topEnd={height-height*0.8}
                      startHeight={80}
                      headerText={"List of items"}
                      headerTextStyle={{color:"white", 
                                       fontSize: 15}}
                      bottomUpSlideBtn={{display: 'flex',
                                       alignSelf: 'flex-start',
                                       backgroundColor: 'black',
                                       alignItems: 'center',
                                       borderTopColor: 'grey',
                                       borderTopWidth: 5}}
      </BottomUpPanel>            
               
  renderBottomUpPanelContent = () =>
          <View>
               <FlatList style={{ backgroundColor: 'black', opacity: 0.7, flex:1}}
                    data={DATA}
                    renderItem={({item}) =>
                                <Text style={{color:'white', padding:20}}>{item}</Text>
                               }
                />
          </View>
          
  renderBottomUpPanelIcon = () =>
        <Ionicons name={"ios-arrow-up"} style={{color:"white"}} size={30}/>        
          
}

Props

  • topEnd: distance from top of the screen
  • startHeight: part of the hidden view that will be visible
  • content: function that renders the panel content inside a scroll view
  • icon: function that renders the panel slide icon that will be rotated
  • headerText: text that is visible at top of the panel
  • headerTextStyle: style applied to that text
  • bottomUpSlideBtn: style applied to the toggle button

Inspired by:

https://github.com/rationalappdev/react-native-bottom-drawer

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