Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kanzitelli committed Nov 21, 2021
1 parent 00c98bf commit 519dcf7
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,55 @@
### Quick start
<p align="center">
<img src="https://xxx-files.ggc.team/oss/rn-bounceable/logo.png" width="80%" title="Logo">
</p>

Make sure you have [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) and [react-native-gesture-handler](https://github.com/software-mansion/react-native-gesture-handler) installed in your project.
## Quick start

```bash
> yarn add rn-bounceable
```

### Usage
Make sure you have [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) and [react-native-gesture-handler](https://github.com/software-mansion/react-native-gesture-handler) installed in your project.

## Usage

```tsx
import {Image} from 'react-native';
import {Bounceable} from 'rn-bounceable';

class OrdersScreen = () => {
class Screen = () => {
return (
<Bounceable onPress={() => alert('onPress')}>
<Image source={imageSource} />
<Bounceable>
<Image source={{uri: 'https://static.expo.dev/static/brand/square-512x512.png'}} />
</Bounceable>
)
}
```

### Example
##### Available props

Example could be found under `expo-example` folder.
```tsx
type BounceableProps = {
onPress?: () => void;
onLongPress?: () => void;
disabled?: boolean; // default: false
noBounce?: boolean; // default: false
immediatePress?: boolean; // default: true
delayLongPress?: number; // default: 800
activeScale?: number; // default: 0.95
delayActiveScale?: number; // default: 0
springConfig?: Animated.WithSpringConfig; // default: { damping: 10, mass: 1, stiffness: 300 }
contentContainerStyle?: StyleProp<ViewStyle>;
};
```

## Example

Examples could be found in `expo-example` folder or in [expo-starter](https://github.com/kanzitelli/expo-starter), [rn-starter](https://github.com/kanzitelli/rn-starter) and [rnn-starter](https://github.com/kanzitelli/rnn-starter).

See it in Expo Go - https://expo.io/@kanzitelli/rn-bounceable-example.

This library was bootstrapped from [kanzitelli/if-component](https://github.com/kanzitelli/if-component).

## License

This project is [MIT licensed](https://github.com/kanzitelli/rn-bounceable/blob/master/LICENSE.md)

0 comments on commit 519dcf7

Please sign in to comment.