react-native-animated-drawer
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

React native animated drawer

React native drawer using react native Animated.

This package currently contains a bare minimum. Feel free to add features and make pull requests.

Usage:

import * as React from "react";
import Sidebar from "../components/Sidebar";
import {Text, View} from 'react-native';
 
interface State {
    isOpen: boolean,
}
 
class HomeScreen extends React.Component<{}, State> {
 
    constructor(props: any) {
        super(props);
        this.state = {isOpen: false};
    }
 
    renderContent() {
        return <View style={{backgroundColor: 'green', flex: 1}}>
            {new Array(10).fill(0).map((o, i) => <Text key={i}>Content</Text>)}
        </View>
    }
 
    renderSidebar() {
        return <View style={{backgroundColor: 'red', flex: 1}}>
            <Text>Sidebar content</Text>
        </View>
    }
 
    render() {
        return <Sidebar
            shouldOpen={() => this.setState({isOpen: true})}
            shouldClose={() => this.setState({isOpen: false})}
            isOpen={this.state.isOpen}
            content={this.renderContent()}
            sidebarContent={this.renderSidebar()}
        />
    }
 
}
 
export default HomeScreen;

Package Sidebar

Install

npm i react-native-animated-drawer

Weekly Downloads

7

Version

1.0.8

License

ISC

Unpacked Size

18.4 kB

Total Files

8

Last publish

Collaborators

  • lukaklacar