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

# Shape tokens

> The corner radius, size and border width tokens of Primer Checkout components in React Native.

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

Shape tokens set how rounded Primer's components are, how large some of their fixed elements are and how thick their borders are. There are three groups, each overridden 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`:

| Group | Type | Controls |
| - | - | - |
| `radii` | `Partial<PrimerRadiusTokens>` | Corner radius scale |
| `sizes` | `Partial<PrimerSizeTokens>` | Size scale |
| `widths` | `Partial<PrimerWidthTokens>` | Border widths per state |

Every token is a number in React Native layout units. You set only the tokens you want to change. The defaults are the same in light and dark mode.

Set tokens for each mode under `light` and `dark`.

## radii

```tsx theme={"dark"}
interface PrimerRadiusTokens {
  xsmall: number;
  small: number;
  medium: number;
  large: number;
}
```

| Token | Default | Description |
| - | - | - |
| `xsmall` | 2 | Card network badges in the card number input's network selector, the accepted card network chips and the brand chip on saved cards. |
| `small` | 4 | Input fields and the header actions in the sheet. Also the network abbreviation chip in the card number input. |
| `medium` | 8 | Buttons and payment method rows, including the Apple Pay button. |
| `large` | 12 | Top corners of `PrimerCheckoutSheet`, and the panel around the saved payment method in the sheet. |

## sizes

```tsx theme={"dark"}
interface PrimerSizeTokens {
  small: number;
  medium: number;
  large: number;
  xlarge: number;
  xxlarge: number;
  xxxlarge: number;
}
```

| Token | Default | Description |
| - | - | - |
| `small` | 16 | Not used by any Primer component. |
| `medium` | 20 | Card icon in the card row of the payment method list, and the check mark and spinner slot of the selected Klarna payment category. |
| `large` | 24 | Height of the Klarna badge on the Klarna screen. |
| `xlarge` | 32 | Horizontal padding around a status screen's message. |
| `xxlarge` | 40 | Minimum height of a Klarna payment category row. |
| `xxxlarge` | 56 | Width of the Klarna badge on the Klarna screen. |

## widths

```tsx theme={"dark"}
interface PrimerWidthTokens {
  default: number;
  focus: number;
  selected: number;
  error: number;
}
```

| Token | Default | Description |
| - | - | - |
| `default` | 1 | Resting border of inputs, also when disabled. Also the border of outlined buttons, the card row in the payment method list and card network badges. |
| `focus` | 2 | Border of a focused input. Never thinner than `default`. |
| `selected` | 2 | Border of a selected item. |
| `error` | 2 | Border of an input in error. Never thinner than `default`. |

An input's border is drawn inside the field, so a thicker border reduces the padding instead of adding height.

## Override shape tokens

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

const shape = {
  radii: { small: 8, medium: 12, large: 20 },
  widths: { default: 1.5, focus: 2.5 },
};

const theme: PrimerThemeOverride = {
  light: { ...shape, colors: { brand: '#6c5ce7' } },
  dark: { ...shape, colors: { brand: '#a29bfe' } },
};
```

Pass `theme` to `PrimerCheckoutProvider`. To change the radius or border of one input only, use the `borderRadius`, `borderWidth`, `focusedBorderWidth` and `errorBorderWidth` keys of its `PrimerTextInputTheme`. See [Card inputs](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/card-form/card-inputs.md).

## 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] [Color tokens](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/theming/color-tokens.md)
>
> All 32 colors with their light and dark defaults.

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


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