• This repository has been archived on 21/May/2020
  • Stars
    star
    221
  • Rank 173,789 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Drawer built with react-motion

ARCHIVED because I didn't have time nor use for this for a long time.

I'd be happy to transfer ownership if someone is interested.

react-motion-drawer

Example | Usage | API | Changelog

Navigation drawer built with the awesome react-motion by @chenglou and react-hammerjs by @JedWatson

npm version

Example

A live demo is available here!

To run the example locally, run:

$ yarn
$ yarn serve

Installation

Via npm:

npm install react-motion-drawer

Usage

import Drawer from 'react-motion-drawer';
  <Drawer open={false} onChange={onChange}>
    <ul>
      <li>Home</li>
      <li>About</li>
      <li>Settings</li>
    </ul>
  </Drawer>

If you want the drawer on the right side of the screen you need the following css.

  body {
    overflow: hidden;
  }

Hooking into the animation

You can hook into the animation by passing a function as the child component.

  <Drawer open={false} width={300} onChange={onChange}>
    { val =>
      <ul style={{ opacity: 300 / val }}>
        <li>Home</li>
        <li>About</li>
        <li>Settings</li>
      </ul>
    }
  </Drawer>

API

Props

Prop Name type default description
zIndex number 10000 z-index of the drawer
noTouchOpen bool false can a user pan to open
noTouchClose bool false can a user pan to close
onChange func () => {} called when the drawer is open
drawerStyle object null additional drawer styles
className object null additional drawer className
overlayClassName object null additional overlay className
config object null configuration of the react-motion animation
open bool false states if the drawer is open
width number 300 width of the drawer
height number 100% height of the drawer
handleWidth number 20 width of the handle
peakingWidth number 50 width that the drawer peaks on press
panTolerance number 50 tolerance until the drawer starts to move
right bool false drawer on the right side of the screen
overlayColor string 'rgba(0, 0, 0, 0.4)' color of the overlay
fadeOut bool false fade out
offset number 0 offset of the drawer

License

MIT © Christoph Hermann

More Repositories

1

awesome-fp-js

😎 A curated list of awesome functional programming stuff in js
5,918
star
2

awesome-frp-js

A curated list of awesome functional reactive programming stuff in js
286
star
3

material-iterm

💻 Light & dark material theme for iterm2
238
star
4

react-cond

Lisp-Style conditional rendering in react.
JavaScript
178
star
5

elm-verify-examples

Elm
166
star
6

redux-elm-middleware

Elm middleware for redux
JavaScript
149
star
7

awesome-ama-answers

A curated list of awesome AMA answers
127
star
8

redux-io

FSA-compliant io monad middleware for redux
JavaScript
66
star
9

compose-function

Function composition
JavaScript
57
star
10

redux-future

FSA-compliant future monad middleware for redux
JavaScript
53
star
11

.dotfiles

🏡
Vim Script
50
star
12

babel-plugin-array-includes

Replaces `arr.includes(val)' with `arr.indexOf(val) >= 0`.
JavaScript
44
star
13

react-mini

Create minimalistic react components
JavaScript
37
star
14

elm-verify

Elm
35
star
15

redux-saga-test

Helper for testing redux-saga
JavaScript
27
star
16

gulp-param

Add params to your tasks
JavaScript
26
star
17

elmi-to-json

Haskell
25
star
18

redux-either

FSA-compliant either monad middleware for redux
JavaScript
23
star
19

react-form-hoc

Higher order component for react forms
JavaScript
22
star
20

gh-contributors-table

🙇 Say "arigatō" to your contributors
JavaScript
21
star
21

recompose-examples

WIP Examples with recompose
JavaScript
20
star
22

mergesort

O(n log n)
JavaScript
20
star
23

underscore.string.fp

This is a wrapper for underscore.string to use it as a FP-library or with Ramda/lodash-fp
JavaScript
20
star
24

react-material-card

A material design card for react
JavaScript
18
star
25

elm-online

Subscribe to online/offline events 📶
Elm
12
star
26

haskell-simple-dsl-examples

Simple examples on how to implement a DSL in Haskell.
Haskell
11
star
27

tasty-test-reporter

An ingredient for tasty that prints a summary and outputs junit xml that works with jenkins.
Haskell
11
star
28

elm-interface-to-json

Haskell
9
star
29

inquander

Inquirer for commander. If no arguments and options are passed to your commander app, it runs inquirer.
JavaScript
8
star
30

pm2-interactive-ui

🚥 interactive cli for pm2
JavaScript
7
star
31

partition-all

Clojure's partition-all in js
JavaScript
7
star
32

extjs5-the-missing-components

This package adds missing components to extjs5.
JavaScript
7
star
33

nix-test-runner

Test runner for nix expressions
Rust
6
star
34

react-mini-this

React components as pure functions with function bind syntax
JavaScript
6
star
35

debug-view

Elm
6
star
36

arityN

Wraps a function with a function of a sertain arity.
JavaScript
5
star
37

grulp

:neckbeard: Never have to worry again if the project is using grunt or gulp. Just use grulp
JavaScript
5
star
38

elm-reflection

Haskell
5
star
39

editable

Elm
5
star
40

radioactive-react-example

Simple example with react and radioactive
JavaScript
5
star
41

create-constants

Create constants
JavaScript
5
star
42

bind-it

DEPRECATED: use stoeffel/bind-first and stoeffel/bind-last
JavaScript
4
star
43

ext.promise

promise for extjs
JavaScript
4
star
44

valid-sift

Check if it's a valid sift filter
JavaScript
3
star
45

compare.js

Comparator functions for you favorite sort-algo
JavaScript
3
star
46

reflux-hoc

Higher-order Component for reflux
JavaScript
3
star
47

if-change-then-notify

Notify me if a certain file changes
JavaScript
3
star
48

set-extra

Elm
3
star
49

pretty-diff

Pretty printing a diff of two values
Haskell
3
star
50

Tetris

A lill tetris developed using raphaeljs
JavaScript
3
star
51

elm-game-of-life

Game of Life in Elm
Elm
3
star
52

expand-object-keys

Expand dotty object keys to objects
JavaScript
3
star
53

underscore.string.cli

String manipulations on the commandline
JavaScript
2
star
54

reassemble-string

🏭 Reassemble your strings
JavaScript
2
star
55

.dots

🏡
Shell
2
star
56

css-longhand-cli

CLI for css-longhand
JavaScript
2
star
57

react-compose

Compose react components
2
star
58

burnhub

Burndown chart for github issues
JavaScript
2
star
59

guard-function

💂‍♂️ You shall not pass!
JavaScript
2
star
60

retrieve-arguments

Retrieves the argumentnames of a function
JavaScript
2
star
61

gulp-macros

sweetjs macros for gulp
JavaScript
2
star
62

abclou

PureScript
2
star
63

advent-of-code-2016

my solutions http://adventofcode.com/
Haskell
2
star
64

tmux-tui

TUI to manage tmux sessions 🚧
Haskell
2
star
65

SEPS-GRP1

JavaScript
2
star
66

elm-check-updates

JavaScript
1
star
67

nur-packages

Nix
1
star
68

format-string

Format a string, using values from an object.
JavaScript
1
star
69

haskell-simple-quasi-quoter

code for small demo on how to use QuasiQuoter
Haskell
1
star
70

Aoc2021

Haskell
1
star
71

hosts_alias

my first ruby gem
Ruby
1
star
72

use-module

angularjs-style DI for nodemodules
JavaScript
1
star
73

flok

flok - Radically Open Business Operation Toolkit
JavaScript
1
star
74

underscore

JavaScript's utility _ belt
JavaScript
1
star
75

resetable

Elm
1
star
76

reverse-arguments

Reverse the arguments passed to a function.
JavaScript
1
star
77

elm-playground

Elm
1
star
78

bn.js.logo

1
star
79

i18next-playground

JavaScript
1
star
80

stoeffel.github.io

🏡
CSS
1
star
81

sencha-leaflet

Leaflet component for sencha touch 2
JavaScript
1
star
82

underscore.hasInside

Recursivly searching for a property by name
JavaScript
1
star
83

ES6-Repl-Chrome-Extension

A Chrome DevTools extension with Google's Traceur transpiler.
JavaScript
1
star
84

lan-camp

CSS
1
star
85

rest-param

💬 Returns a function with an appended rest param
JavaScript
1
star
86

array-comprehensions

Functional array comprehension
JavaScript
1
star
87

fparser-cli

a cli for bylexus's fparser
JavaScript
1
star