React native implementation of PayPal Buttons Expo snack Demo
npm install react-native-paypal-buttons
This package uses PayPalOpen-Regular
font for the button labels.
Bare React Native
- Update
react-native.config.js
... assets: [ "./node_modules/react-native-paypal-buttons/src/assets/fonts" ]
- Run command
npx react-native-asset
Expo
- Install the
expo-font
package:expo install expo-font
- Update expo config
{ "expo": { "plugins": [ [ "expo-font", { "fonts": ["./node_modules/react-native-paypal-buttons/src/assets/fonts/PayPalOpen-Regular.otf"] } ] ] } }
import {
PayPalButton,
PayPalCreditButton,
PayPalPayLaterButton,
} from 'react-native-paypal-buttons';
const MyComponent = () => (
<>
<PayPalButton />
<PayPalPayLaterButton />
<PayPalCreditButton />
</>
);
Any PressableProps and the following:
Prop | Values | Default Value |
---|---|---|
edges |
PaymentButtonEdges.HARD_EDGES , PaymentButtonEdges.SOFT_EDGES , PaymentButtonEdges.ROUNDED , or a custom number |
PaymentButtonEdges.SOFT_EDGES |
size |
PaymentButtonSize.MINI , PaymentButtonSize.COLLAPSED , PaymentButtonSize.EXPANDED , PaymentButtonSize.FULL |
PaymentButtonSize.EXPANDED |
Prop | Values | Default Value |
---|---|---|
color |
PayPalButtonColor.GOLD , PayPalButtonColor.WHITE , PayPalButtonColor.BLACK , PayPalButtonColor.SILVER , PayPalButtonColor.BLUE |
PayPalButtonColor.GOLD |
label |
PayPalButtonLabel.NONE , PayPalButtonLabel.CHECKOUT , PayPalButtonLabel.BUY_NOW , PayPalButtonLabel.PAY_WITH |
PayPalButtonLabel.NONE |
Prop | Values | Default Value |
---|---|---|
color |
PayLaterButtonColor.GOLD , PayLaterButtonColor.WHITE , PayLaterButtonColor.BLACK , PayLaterButtonColor.SILVER , PayLaterButtonColor.BLUE |
PayLaterButtonColor.GOLD |
Prop | Values | Default Value |
---|---|---|
color |
CreditButtonColor.WHITE , CreditButtonColor.BLACK , CreditButtonColor.DARK_BLUE |
CreditButtonColor.WHITE |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library