react-native-drag-reveal-fab

0.0.4 • Public • Published


React Native Drag Reveal Fab

Usage

A view can be revealed by dragging its fab

installation :

npm install react-native-drag-reveal-fab --save

import :

import DragReveal from 'react-native-drag-reveal-fab'

usage :

import React, {Component} from 'react';
import {Platform, StyleSheet, View, Dimensions, Text} from 'react-native';
import DragReveal from "./DragReveal";
 
const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});
 
type Props = {};
export default class App extends Component<Props> {
    constructor(props) {
        super(props);
 
    }
    render() {
        return (
            <View style={styles.container} >
                <Text>
                    {instructions}
                </Text>
               <DragReveal
                  icon // this you can render a custom icon that will be shown when fab minimized
                  onExpand //this happens on reveal
                  backgroundColor {'#004D40'}>
                  {/* this content will reveal*/}
              </DragReveal>
            </View>
        );
    }
 
}
 
const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    2
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i react-native-drag-reveal-fab

Weekly Downloads

2

Version

0.0.4

License

SEE LICENSE IN LICENCE

Unpacked Size

1.65 MB

Total Files

4

Last publish

Collaborators

  • lvlrsajjad