Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ericpkerr/react-native-animated-styles

Easily animate react-native components between two styles.
https://github.com/ericpkerr/react-native-animated-styles

Last synced: about 1 month ago
JSON representation

Easily animate react-native components between two styles.

Awesome Lists containing this project

README

        

# react-native-animated-styles

Easily animate react-native components between two styles. Similar concept to adding and removing a CSS class to animate HTML Elements for the web.

# Install

`npm install --save react-native-animated-styles`

# Properties

```

```

# Example Usage

```
import AnimatedStyles from 'react-native-animated-styles';
import { useEffect, useState } from 'react';

const MyComponent = () => {
const [ active, setActive ] = useState(true);

useEffect(() => {
setInterval(() => {
setActive((active) => !active);
}, 3000);
}, []);

return (



)
};

const styles = StyleSheet.create({
wrap: {
flex: 1,
alignItems: 'center',
justifyContent: 'center'
},

box: {
backgroundColor: 'rgb(73, 0, 9)', // normalizes colors
width: 80,
height: 80
},

boxActive: {
width: 100,
height: 100,
backgroundColor: '#AC0E28',
transform: [
{ rotate: '45deg' } // uses default values for transform properties
]
}
});
```

![Example](https://github.com/EricPKerr/react-native-animated-styles/blob/master/Example.gif?raw=true)