Skip to navigation

Pay Kit Android: UI Components

Pay Kit provides an unmanaged CashAppPayButton and a CashAppPaymentMethod view, in both Jetpack Compose and View-based versions. They are an optional dependency, and must be included separately.

Buttons

The button is unmanaged. It is a stylized button that isn’t aware of SDK events out-of-the-box. It is the developer’s responsibility to call authorizeCustomerRequest() when the button is clicked and to manage any disabled and loading states.

Labels

By default, the button shows the Cash App icon and “Cash App Pay”. Set label to show a call to action instead:

LabelTextUse it for
CashAppPay”Cash App Pay”The default, with no call to action
CashApp”Cash App”No call to action
Pay”Pay with Cash App”Payments
Buy”Buy with Cash App”Buy-now payments, or as an alternative to Checkout
CashOut”Cash out with Cash App”Payouts
Checkout”Checkout with Cash App”Checkout pages
Continue”Continue with Cash App”Requests where the customer authorizes several kinds of actions, not only payments or payouts
Connect”Connect to Cash App”Linking the customer’s Cash App account, such as saving it for future payments

Styles

The button comes in these styles:

  • Default (default): White label and green Cash App icon on a black background
  • Light: Black label and green Cash App icon on a white background with a thin black outline
  • MonochromeDark: White label and icon on a black background
  • MonochromeLight: Black label and icon on a white background with a thin black outline
  • Alt: Black label and icon on a Cash App green background
  • Auto: Follows the system’s light or dark mode, showing Default in light mode and Light in dark mode
  • Monochrome: Follows the system’s light or dark mode, showing MonochromeDark in light mode and MonochromeLight in dark mode

Only Auto and Monochrome change when your app switches between light and dark mode. The examples below show every label in Default and Light, the disabled variants, and the default label in the monochrome and Alt styles.

Pay Kit Android buttons: the default Cash App Pay label, the Cash App label, and the Pay with, Buy with, Cash out with, Checkout with, Continue with, and Connect to Cash App labels, in the Default, Light, disabled, monochrome, and Alt styles

You can change the size of the buttons within certain limits:

  • at least 34dp tall
  • at least 122dp wide
  • at most 54dp tall

Jetpack Compose

To add the Jetpack Compose version of the button, use the following implementation:

implementation "app.cash.paykit:ui-compose:X.Y.Z"

Or via Gradle version catalogs (libs.toml):

group = "app.cash.paykit", name = "ui-compose"
@Composable
fun CashAppPayButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
style: CashAppPayButtonStyle = CashAppPayButtonStyle.Default,
enabled: Boolean = true,
label: CashAppPayButtonLabel = CashAppPayButtonLabel.CashAppPay,
)

For example:

CashAppPayButton(
onClick = { cashAppPay.authorizeCustomerRequest() },
)

With a call to action:

CashAppPayButton(
onClick = { cashAppPay.authorizeCustomerRequest() },
label = CashAppPayButtonLabel.Checkout,
)

View-based

To add the Views version of the button, use the following:

implementation "app.cash.paykit:ui-views:X.Y.Z"

Or via Gradle version catalogs (libs.toml):

group = "app.cash.paykit", name = "ui-views"

Use one of the @style/CAPButtonStyle styles (Default, Light, MonochromeDark, MonochromeLight, Alt, Auto, or Monochrome), and optionally set the label with app:cap_label (cash_app_pay, the default, cash_app, pay, buy, cash_out, checkout, continue_with, or connect):

<app.cash.paykit.ui.views.CashAppPayButton
style="@style/CAPButtonStyle.Default"
app:cap_label="pay"
android:layout_height="48dp"
android:layout_marginTop="4dp"
android:layout_width="match_parent"
android:layout_marginHorizontal="8dp"
/>

Or set it in code:

button.label = CashAppPayButtonLabel.Pay

CashAppPaymentMethod

CashAppPaymentMethod shows the Cash App Pay logo and the customer’s Cashtag, for example after the customer approves a request. It comes in a Large layout (Cashtag to the right of the logo) and a Small layout (Cashtag under the logo).

The monochrome logo follows the system’s light or dark theme. Set usePolychromeAsset to show the green Cash App icon: on a black background in light mode, and on a green background in dark mode.

To show the “Cash App” logo instead of “Cash App Pay”, set label = CashAppPaymentMethodLabel.CashApp in Jetpack Compose, or app:cap_label="cash_app" in a View-based layout.

Pay Kit Android CashAppPaymentMethod: large, small, polychrome, and dark mode with the Cash App Pay logo, then large with the Cash App logo, each showing $jack

In Jetpack Compose:

CashAppPaymentMethod(
cashtag = "\$jack",
size = CashAppPaymentMethodSize.Large,
// Optional: show the "Cash App" logo
// label = CashAppPaymentMethodLabel.CashApp,
)

In a View-based layout:

<app.cash.paykit.ui.views.CashAppPaymentMethod
app:cap_cashtag="$jack"
app:cap_size="large"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>