Skip to main content
Primer Checkout React Native SDK is currently in beta (v3.0.0-beta.1). The API is subject to change before the stable release.
The status screens are the loading, success and error views that PrimerCheckoutSheet shows. They are exported so you can show the same screens in your own layout, for example from the state of usePrimerCheckout. Each screen fills the width of its parent and centers its content. Wrap a screen in your own View to size and position it. The props types are exported as PrimerLoadingScreenProps, PrimerSuccessScreenProps, PrimerErrorScreenProps and PrimerStatusScreenLayoutProps.
The status screens work inside and outside PrimerCheckoutProvider. Inside it, they use your theme and settings.uiOptions.appearanceMode. Outside it, they use the default theme in the device’s color scheme. Their default text always follows the device locale, see usePrimerLocalization. The tables below show the English defaults.

PrimerLoadingScreen

PrimerSuccessScreen

The timer restarts when onDismiss or autoDismissMs changes. Pass a stable onDismiss, for example one wrapped in useCallback, or the timer restarts on every render of the parent. Unmounting the screen cancels the timer.

PrimerErrorScreen

PrimerStatusScreenLayout

Use it to build your own status screen that matches the others.

Usage in a custom layout

Show a status screen from the checkout state. This example covers initialization, success, a pending payment and failure:
Pass a stable onDone, for example one the parent wraps in useCallback, so the success timer does not restart.
To show your own result screens after PrimerCheckoutSheet, set settings.uiOptions.isSuccessScreenEnabled or isErrorScreenEnabled to false. The sheet then skips that screen, clears paymentOutcome and calls onRequestDismiss, so keep the result yourself when it arrives. See PrimerSettings.

See also

usePrimerCheckout

isReady, error and paymentOutcome

Handle the payment result

Route your UI on the payment result

Color tokens

The tokens the status screens use

usePrimerLocalization

Where the default text comes from