react-native-bpk-styles
Common styles for React Native components.
Installation
npm install react-native-bpk-styles --save-dev
Shadows
The package includes definitions for the Backpack shadows. These are available as objects that can be spread in style definitions. These are iOS only and need to be complemented with an appropriate elevation for Android.
Usage
;;;; const styles = StyleSheet; const MyComponent = { const focused children = props; return <View style=stylescomponent focused && stylescomponentFocused> children </View> ;}; ;
Gradients
The package includes definitions for the Backpack gradients. These are available as objects that can be spread in the props of a LinearGradient
from react-native-linear-gradient
.
Usage
;;;;; const MyComponent = { return <View> <LinearGradient ...gradients> children </LinearGradient> <LinearGradient ...gradients> children </LinearGradient> </View> ;}; ;
API
The gradients.primary
function takes an optional argument indicating the direction(given by the start to end) of the gradient. The valid directions are available in gradients.ANGLES
and are:
ANGLES.down
ANGLES.right
ANGLES.left
ANGLES.up
ANGLES.topLeft
ANGLES.topRight
ANGLES.bottomLeft
ANGLES.bottomRight