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

# PrimerCheckoutHost

> Inline host composable for embedding checkout components directly in your layout

<Warning>
  Primer Checkout Android SDK is currently in **beta** (v3.0.0-beta.4).
  The API is subject to change before the stable release.
</Warning>

Composable that wraps your custom checkout layout with `PrimerTheme` and required `CompositionLocal` providers. Renders SDK components inline rather than in a modal bottom sheet. Overlay sheets for 3DS and redirect flows are handled automatically.

## Signature

```kotlin theme={"dark"}
@Composable
fun PrimerCheckoutHost(
    checkout: PrimerCheckoutController,
    modifier: Modifier = Modifier,
    theme: PrimerTheme = PrimerTheme(),
    beforePaymentCreate: (@Composable (handler: PrimerPaymentCreationDecisionHandler) -> Unit)? = null,
    content: @Composable () -> Unit,
)
```

<Note>
  There is no `onEvent` callback. With the inline host you build your own result UI —
  observe [`checkout.state`](/docs/sdk/android-checkout/v3.0.0-beta/api/primer-checkout-state)
  for `PrimerCheckoutState.Success` / `PrimerCheckoutState.Failure` and render accordingly.
</Note>

## Parameters

| Parameter             | Type                                                                        | Default         | Description                                                                                                                                                                                                                                              |
| --------------------- | --------------------------------------------------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `checkout`            | `PrimerCheckoutController`                                                  | Required        | Checkout controller providing session state to child components                                                                                                                                                                                          |
| `modifier`            | `Modifier`                                                                  | `Modifier`      | Modifier applied to the host container                                                                                                                                                                                                                   |
| `theme`               | [`PrimerTheme`](/docs/sdk/android-checkout/v3.0.0-beta/api/theming/primer-theme) | `PrimerTheme()` | Design tokens applied to all SDK components within the host                                                                                                                                                                                              |
| `beforePaymentCreate` | `(@Composable (PrimerPaymentCreationDecisionHandler) -> Unit)?`             | `null`          | Optional gate shown right before payment creation — run last-minute checks or set an idempotency key, then call `handler.continuePaymentCreation(idempotencyKey)` or `handler.abortPaymentCreation(message)`. Omit to let the SDK proceed automatically. |
| `content`             | `@Composable () -> Unit`                                                    | Required        | Your custom layout containing SDK components (trailing lambda)                                                                                                                                                                                           |

## What it provides

1. **PrimerTheme** — applies design tokens so child components inherit your styling
2. **CompositionLocal providers** — injects checkout context so `remember*Controller()` functions work
3. **Overlay management** — renders overlays for 3DS challenges and redirect flows automatically

Without `PrimerCheckoutHost`, SDK components like `PrimerCardForm` and `PrimerPaymentMethods` will not function.
