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

# Color tokens

> The 32 color tokens of Primer Checkout for React Native, with their light and dark defaults.

> [!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.

`PrimerColorTokens` holds the 32 colors that Primer's components draw with. You override them per mode in the [`theme`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/theming/primer-theme-override) prop of `PrimerCheckoutProvider`, under `light.colors` and `dark.colors`. Both take `Partial<PrimerColorTokens>`, so you set only the colors you want to change.

Each value is a React Native color string. The defaults are hex `#rrggbb`, or `#rrggbbaa` when the color has transparency. `overlay` is the exception: it defaults to `rgba(0,0,0,0.5)`.

Light and dark are separate. A color you set under `light` isn't used in dark mode, and a color you leave out of `dark` keeps the dark default, unless it follows another dark color you set (see [Tokens that follow others](#tokens-that-follow-others)).

> [!TIP]
>
> Start with `brand`. Primary buttons such as Pay use it, and focus borders, loaders and selected borders follow it unless you set them. If your app supports dark mode, set `brand` under `dark` too.

## Brand

| Token | Light default | Dark default | Description |
| - | - | - | - |
| `brand` | `#2f98ff` | `#2f98ff` | Primary brand color. Fills primary buttons, such as Pay in the sheet and Retry on the error screen, and tints the check mark on the selected saved payment method and Klarna payment category. `focus`, `loader` and `borderOutlinedSelected` follow it unless you set them. |
| `onBrand` | `#ffffff` | `#171619` | Label and spinner on primary buttons. Follows `backgroundPrimary` unless set. |

## Background

| Token | Light default | Dark default | Description |
| - | - | - | - |
| `backgroundPrimary` | `#ffffff` | `#171619` | Sheet background and the fill of outlined buttons. `backgroundOutlinedDefault` and `onBrand` follow it unless you set them. |
| `backgroundSecondary` | `#2121210a` | `#efefef0a` | Accepted card network chips, the panel around the saved payment method in the sheet, the selected row in the country list, the pressed row in the card network popover, and the brand chip on saved cards. |
| `backgroundOutlinedDefault` | `#ffffff` | `#171619` | Input field fill and the card row in the payment method list. Follows `backgroundPrimary` unless set. |
| `backgroundOutlinedDisabled` | `#2121210a` | `#efefef0a` | Fill of a disabled input and of a disabled primary button. |

## Text

| Token | Light default | Dark default | Description |
| - | - | - | - |
| `textPrimary` | `#212121` | `#efefef` | Main text: screen titles, input labels, payment method labels, outlined button labels and status screen titles. `textOutlinedDefault` follows it unless you set it. |
| `textSecondary` | `#2121219e` | `#efefef9e` | Secondary text, such as status screen subtitles. The sheet's drag handle uses it at reduced opacity. |
| `textPlaceholder` | `#21212170` | `#efefef70` | Input placeholders. |
| `textDisabled` | `#2121214d` | `#efefef4d` | Text and label of a disabled input, and the label of a disabled primary button. |
| `textNegative` | `#b4324b` | `#f6bfbf` | Field error messages. |
| `textLink` | `#2270f4` | `#4aaeff` | Reserved. No component reads this token. |
| `textOutlinedDefault` | `#212121` | `#efefef` | Text typed into inputs. Follows `textPrimary` unless set. |

## Border colors (outlined)

| Token | Light default | Dark default | Description |
| - | - | - | - |
| `borderOutlinedDefault` | `#21212124` | `#efefef24` | Resting border of inputs, outlined buttons, the card row in the payment method list and card network badges. Also the divider above the billing address in the sheet. |
| `borderOutlinedActive` | `#21212170` | `#efefef70` | Reserved. No component reads this token. |
| `borderOutlinedFocus` | `#2f98ff` | `#2f98ff` | Border of a focused input, and the text cursor and selection color. Follows `focus` unless set. |
| `borderOutlinedDisabled` | `#21212112` | `#efefef12` | Border of a disabled input. |
| `borderOutlinedError` | `#ff7279` | `#e46d70` | Border of an input in error. |
| `borderOutlinedSelected` | `#2f98ff` | `#2f98ff` | Border of a selected item. Follows `brand` unless set. |
| `borderOutlinedLoading` | `#21212112` | `#efefef12` | Reserved. No component reads this token. |

## Border colors (transparent)

Reserved for elements with a transparent border. No component reads these tokens.

| Token | Light default | Dark default | Description |
| - | - | - | - |
| `borderTransparentDefault` | `#ffffff00` | `#ffffff00` | Reserved. |
| `borderTransparentActive` | `#ffffff00` | `#ffffff00` | Reserved. |
| `borderTransparentFocus` | `#2f98ff` | `#2f98ff` | Reserved. Follows `focus` unless set. |
| `borderTransparentDisabled` | `#ffffff00` | `#ffffff00` | Reserved. |
| `borderTransparentSelected` | `#ffffff00` | `#ffffff00` | Reserved. |

## Icon colors

| Token | Light default | Dark default | Description |
| - | - | - | - |
| `iconPrimary` | `#212121` | `#efefef` | Default icon color, such as the Back chevron in the sheet header and the card icon in the payment method list. |
| `iconDisabled` | `#2121214d` | `#efefef4d` | Reserved. No component reads this token. |
| `iconNegative` | `#ff7279` | `#e46d70` | Error screen icon. |
| `iconPositive` | `#3eb68f` | `#27b17d` | Success screen icon. |

## Utility

| Token | Light default | Dark default | Description |
| - | - | - | - |
| `focus` | `#2f98ff` | `#2f98ff` | Focus color. `borderOutlinedFocus` and `borderTransparentFocus` follow it unless you set them. Follows `brand` unless set. |
| `loader` | `#2f98ff` | `#2f98ff` | Loading spinners, such as the one on the loading screen. Follows `brand` unless set. |
| `overlay` | `rgba(0,0,0,0.5)` | `rgba(0,0,0,0.5)` | Backdrop behind `PrimerCheckoutSheet`. |

## Override colors

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

const theme: PrimerThemeOverride = {
  light: {
    colors: {
      brand: '#6c5ce7',
      backgroundPrimary: '#ffffff',
      textPrimary: '#1a1a1f',
      borderOutlinedError: '#e53935',
    },
  },
  dark: {
    colors: {
      brand: '#a29bfe',
      backgroundPrimary: '#17171a',
      textPrimary: '#f0f0f0',
      borderOutlinedError: '#ef5350',
    },
  },
};
```

Pass `theme` to `PrimerCheckoutProvider`. See [PrimerThemeOverride](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/theming/primer-theme-override.md) for how to apply it and how to choose the mode.

## Tokens that follow others

Some tokens follow another token in the same mode unless you set them too, so one change can recolor several elements:

* `brand` moves `focus`, `loader` and `borderOutlinedSelected`. Through `focus`, it also moves `borderOutlinedFocus` and `borderTransparentFocus`.
* `focus` moves `borderOutlinedFocus` and `borderTransparentFocus`.
* `backgroundPrimary` moves `backgroundOutlinedDefault` and `onBrand`.
* `textPrimary` moves `textOutlinedDefault`.

A token you set always wins over the token it follows. A token follows only when you change its source away from that mode's default.

## See also

> [card] [PrimerThemeOverride](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/theming/primer-theme-override.md)
>
> Apply a theme, choose light or dark mode and read tokens with usePrimerTheme.

> [card] [Typography tokens](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/theming/typography-tokens.md)
>
> The brand font and the six text styles.

> [card] [Spacing tokens](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/theming/spacing-tokens.md)
>
> The padding and gap scale.

> [card] [Shape tokens](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/theming/shape-tokens.md)
>
> Corner radii, sizes and border widths.


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