> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Status screens

> Loading, success and error screen components you can render in your own checkout layout.

> [!WARNING]
>
> 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`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/primer-checkout-sheet) shows. They are exported so you can show the same screens in your own layout, for example from the state of [`usePrimerCheckout`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/use-primer-checkout).

| Component | Shows |
| - | - |
| `PrimerLoadingScreen` | A spinner with a title and subtitle |
| `PrimerSuccessScreen` | A check mark with a title and subtitle, and an optional auto-dismiss timer |
| `PrimerErrorScreen` | An error icon with a title and subtitle, and optional Retry and "Choose other payment methods" buttons |
| `PrimerStatusScreenLayout` | The layout the other three use: an icon, a title, a subtitle and optional content below |

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`.

> [!NOTE]
>
> The status screens work inside and outside [`PrimerCheckoutProvider`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/primer-checkout-provider). 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`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/common/use-primer-localization). The tables below show the English defaults.

## PrimerLoadingScreen

```tsx theme={"dark"}
import { PrimerLoadingScreen } from '@primer-io/react-native';

export function CheckoutLoading() {
  return <PrimerLoadingScreen />;
}
```

| Prop | Type | Default | Description |
| - | - | - | - |
| `title` | `string` | "Loading" | Title text. |
| `subtitle` | `string` | "This may take a few seconds." | Subtitle text. |
| `icon` | `ReactNode` | SDK spinner | Replaces the spinner. The default spinner uses the `loader` color token. |

## PrimerSuccessScreen

```tsx theme={"dark"}
import { PrimerSuccessScreen } from '@primer-io/react-native';

export function PaymentDone({ onDone }: { onDone: () => void }) {
  return <PrimerSuccessScreen onDismiss={onDone} autoDismissMs={3000} />;
}
```

| Prop | Type | Default | Description |
| - | - | - | - |
| `title` | `string` | "Payment successful" | Title text. |
| `subtitle` | `string` | "You'll be redirected to the order confirmation page soon." | Subtitle text. |
| `icon` | `ReactNode` | Check mark | Replaces the check mark. The default icon uses the `iconPositive` color token. |
| `onDismiss` | `() => void` | — | Called once `autoDismissMs` milliseconds after the screen mounts. |
| `autoDismissMs` | `number` | — | Delay before `onDismiss` is called. The timer runs only when both `onDismiss` and `autoDismissMs` are set. |

> [!WARNING]
>
> 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

```tsx theme={"dark"}
import { PrimerErrorScreen } from '@primer-io/react-native';

type PaymentFailedProps = { onRetry: () => void; onChooseOther: () => void };

export function PaymentFailed({ onRetry, onChooseOther }: PaymentFailedProps) {
  return (
    <PrimerErrorScreen
      subtitle="Your payment didn't go through."
      onRetry={onRetry}
      onChooseOtherMethod={onChooseOther}
    />
  );
}
```

| Prop | Type | Default | Description |
| - | - | - | - |
| `title` | `string` | "Payment failed" | Title text. |
| `subtitle` | `string` | "Please try again or use another payment method." | Subtitle text. |
| `icon` | `ReactNode` | Error icon | Replaces the error icon. The default icon uses the `iconNegative` color token. |
| `onRetry` | `() => void` | — | Shows a primary "Retry" button that calls this function. Without it, the button is hidden. |
| `onChooseOtherMethod` | `() => void` | — | Shows an outlined "Choose other payment methods" button that calls this function. Without it, the button is hidden. |
| `retryLabel` | `string` | "Retry" | Label of the Retry button. |
| `otherMethodLabel` | `string` | "Choose other payment methods" | Label of the other-methods button. |

## PrimerStatusScreenLayout

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

```tsx theme={"dark"}
import type { ReactNode } from 'react';
import { Button } from 'react-native';
import { PrimerStatusScreenLayout } from '@primer-io/react-native';

type OrderPlacedProps = { icon: ReactNode; onBack: () => void };

export function OrderPlaced({ icon, onBack }: OrderPlacedProps) {
  return (
    <PrimerStatusScreenLayout icon={icon} title="Order placed" subtitle="We've emailed your receipt.">
      <Button title="Back to shop" onPress={onBack} />
    </PrimerStatusScreenLayout>
  );
}
```

| Prop | Type | Default | Description |
| - | - | - | - |
| `icon` | `ReactNode` | Required | Content shown above the text. The built-in icons are 56 × 56. |
| `title` | `string` | Required | Title text, in the `bodyLarge` typography style and the `textPrimary` color. |
| `subtitle` | `string` | Required | Subtitle text, in the `bodyMedium` typography style and the `textSecondary` color. |
| `children` | `ReactNode` | — | Content shown below the text at full width, for example buttons. |

## Usage in a custom layout

Show a status screen from the checkout state. This example covers initialization, success, a pending payment and failure:

```tsx theme={"dark"}
import {
  PrimerErrorScreen,
  PrimerLoadingScreen,
  PrimerSuccessScreen,
  usePrimerCheckout,
} from '@primer-io/react-native';

export function CheckoutStatus({ onDone }: { onDone: () => void }) {
  const { isReady, error, paymentOutcome, clearPaymentOutcome } = usePrimerCheckout();

  if (error) {
    return <PrimerErrorScreen title="Checkout unavailable" subtitle="We couldn't load the checkout." />;
  }
  if (!isReady) {
    return <PrimerLoadingScreen />;
  }
  if (paymentOutcome?.status === 'success') {
    return <PrimerSuccessScreen onDismiss={onDone} autoDismissMs={3000} />;
  }
  if (paymentOutcome?.status === 'pending') {
    return (
      <PrimerSuccessScreen
        title="Payment pending"
        subtitle="We'll email you once the payment is confirmed."
        onDismiss={onDone}
        autoDismissMs={3000}
      />
    );
  }
  if (paymentOutcome?.status === 'error') {
    return (
      <PrimerErrorScreen
        subtitle="Your payment didn't go through."
        onChooseOtherMethod={clearPaymentOutcome}
      />
    );
  }
  return null;
}
```

Pass a stable `onDone`, for example one the parent wraps in `useCallback`, so the success timer does not restart.

> [!NOTE]
>
> 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`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/common/primer-settings#uioptions).

## See also

> [card] [usePrimerCheckout](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/use-primer-checkout.md)
>
> `isReady`, `error` and `paymentOutcome`

> [card] [Handle the payment result](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/guides/handle-payment-result.md)
>
> Route your UI on the payment result

> [card] [Color tokens](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/theming/color-tokens.md)
>
> The tokens the status screens use

> [card] [usePrimerLocalization](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/common/use-primer-localization.md)
>
> Where the default text comes from


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.