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

# CardFormDefaults

> Pre-built sub-components for customizing PrimerCardForm slots

> [!WARNING]
>
> Primer Checkout Android SDK is currently in **beta** (v3.0.0-beta.8).
> The API is subject to change before the stable release.

Object providing pre-built composable functions for each part of the card form. Use these to rearrange or selectively replace sections of `PrimerCardForm`.

## Card detail fields

| Function | Description |
| - | - |
| `CardNumberField(controller, modifier)` | Card number input with auto-formatting, Luhn validation, and network icon |
| `ExpiryField(controller, modifier)` | Expiry date input with MM/YY auto-formatting |
| `CvvField(controller, modifier)` | CVV input with dynamic length based on card network |
| `CardholderField(controller, modifier)` | Cardholder name input. Only rendered when required by session. |
| `CardNetworkField(controller)` | Co-badge network selector. Only rendered for co-badged cards. |

All field functions accept `controller: PrimerCardFormController` and `modifier: Modifier = Modifier` (except `CardNetworkField` which has no modifier).

## Billing address fields

| Function | Description |
| - | - |
| `CountryCodeField(controller, modifier)` | Country selector that opens a picker dialog |
| `FirstNameField(controller, modifier)` | Billing first name input |
| `LastNameField(controller, modifier)` | Billing last name input |
| `AddressLine1Field(controller, modifier)` | Street address line 1 |
| `AddressLine2Field(controller, modifier)` | Street address line 2 (optional) |
| `CityField(controller, modifier)` | City name input |
| `StateField(controller, modifier)` | State or region input |
| `PostalCodeField(controller, modifier)` | Postal or ZIP code input |

Only rendered when required by the session configuration.

## Content composables

### CardDetailsContent

```kotlin theme={"dark"}
@Composable
fun CardFormDefaults.CardDetailsContent(
    controller: PrimerCardFormController,
    cardNumber: @Composable () -> Unit = { CardNumberField(controller) },
    expiryDate: @Composable () -> Unit = { ExpiryField(controller) },
    cvv: @Composable () -> Unit = { CvvField(controller) },
    cardholderName: @Composable () -> Unit = { CardholderField(controller) },
)
```

Renders the default card details layout. Each field can be individually replaced via slot parameters.

### BillingAddressContent

```kotlin theme={"dark"}
@Composable
fun CardFormDefaults.BillingAddressContent(
    controller: PrimerCardFormController,
    countryCode: @Composable () -> Unit = { CountryCodeField(controller) },
    firstName: @Composable () -> Unit = { FirstNameField(controller) },
    lastName: @Composable () -> Unit = { LastNameField(controller) },
    addressLine1: @Composable () -> Unit = { AddressLine1Field(controller) },
    addressLine2: @Composable () -> Unit = { AddressLine2Field(controller) },
    city: @Composable () -> Unit = { CityField(controller) },
    state: @Composable () -> Unit = { StateField(controller) },
    postalCode: @Composable () -> Unit = { PostalCodeField(controller) },
)
```

Renders the default billing address layout. Only renders fields required by the session.

## Submit button

### SubmitButton

```kotlin theme={"dark"}
@Composable
fun CardFormDefaults.SubmitButton(
    controller: PrimerCardFormController,
    modifier: Modifier = Modifier,
)
```

Default pay button that displays the formatted amount, disables when invalid or submitting, and shows a loading indicator during submission.


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