Skip to main content
Primer Checkout Android SDK is currently in beta (v3.0.0-beta.2). The API is subject to change before the stable release.
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

@Composable
fun PrimerCheckoutHost(
    checkout: PrimerCheckoutController,
    modifier: Modifier = Modifier,
    onEvent: (PrimerCheckoutEvent) -> Unit = {},
    theme: PrimerTheme = PrimerTheme(),
    content: @Composable () -> Unit,
)

Parameters

ParameterTypeDefaultDescription
checkoutPrimerCheckoutControllerRequiredCheckout controller providing session state to child components
modifierModifierModifierModifier applied to the host container
onEvent(PrimerCheckoutEvent) -> Unit{}Payment outcome events. See PrimerCheckoutEvent
themePrimerThemePrimerTheme()Design tokens applied to all SDK components within the host
content@Composable () -> UnitRequiredYour 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.