Skip to content

A npm react-native package for making any element flippable using gestures.

License

Notifications You must be signed in to change notification settings

3DJakob/react-native-flippable

Repository files navigation

React Native Flippable

A npm react-native package for making any element flippable using gestures.

The flippable content can be any react-native element. The flip can be trigger by velocity, drag or tap.

The size of the flippable content is determined by the size of the first child.

Installation

npm install react-native-flippable --save

Usage

import Flippable from 'react-native-flippable'

...

<Flippable>
  <View>
    <Text>Front</Text>
  </View>
  <View>
    <Text>Back</Text>
  </View>
</Flippable>

Props

children

  • required
  • type: React.ReactNode

The children to be flipped. The first child will be the front, the second child will be the back.

flipOnTap

  • optional
  • type: boolean

If the card should be flipped if the user taps on it.

API

flipLeft

  • optional
  • type: () => void

Programmatically trigger a flip to the left.

flipRight

  • optional
  • type: () => void

Programmatically trigger a flip to the right.

About

A npm react-native package for making any element flippable using gestures.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published