Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zecaptus/react-native-md-motion-buttons

A simple animated transition based on the dribble from invision.
https://github.com/zecaptus/react-native-md-motion-buttons

android animation button invision ios javascript material material-design motion react react-native transition

Last synced: 21 days ago
JSON representation

A simple animated transition based on the dribble from invision.

Awesome Lists containing this project

README

        

# react-native-md-motion-buttons (iOS / Android)

[![npm version](https://badge.fury.io/js/react-native-md-motion-buttons.svg)](https://badge.fury.io/js/react-native-md-motion-buttons)

I wanted to re-create this animation with react-native (https://dribbble.com/shots/1945593-Login-Home-Screen)

![Example](examples/doc/button.gif)

# Installation

`npm install react-native-md-motion-buttons --save`

# Usage

```jsx
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Button
} from 'react-native';
import { Login } from 'react-native-md-motion-buttons';

class Home extends Component {
render() {
return (

New screen

)
}
}

export default class examples extends Component {
render() {
const promise = () => new Promise((resolve, reject) => setTimeout(() => resolve(), 2000) );

return (
}>


Welcome to React Native!


To get started, edit index.ios.js


Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu


)
}
}
```

#### View Props

| Prop | Type | Description |
|---|---|---|
|**`children`**|`ReactElement`|React Element(s) to render. **Button must be a direct child.**|
|**`homeScreen`**|`ReactElement`|New screen to render after the animation. `` expose a `logout` function as a prop to this Component |
|**`style`**|`StyleSheet`|Apply style to the View|

#### Button Props

| Prop | Type | Description |
|---|---|---|
|**`title`**|`?String`|Button title. _Default : 'Login'_|
|**`color`**|`?String`|Text color. _Default: 'white'_|
|**`style`**|`StyleSheet`|Apply style to the Button. _**backgroundColor** is required_|
|**`onPress`**|`() => Promise>`|Handle button click. **Must returned a promise**|

# Roadmap

## Next release

- [x] Add ripple effect for button
- [ ] Add a Floating Action Button (FAB) which will move to the center (like inVision dribble)