Purpl
Docs menu

Purpl Docs

Paywall UI

Define the purchase options and order for a sale and present them in a Compose paywall.

Sales catalog

PurchaseCatalog contains only the purchase options and display order for the current paywall. Keep the complete product registry and entitlement mappings in PurchaseConfiguration.

Present a paywall

Compose
import sh.purpl.*
import sh.purpl.ui.*

PaywallView(
    purchases = purchases,
    configuration = PaywallConfiguration(
        catalog = standardCatalog,
        defaultPurchaseOptionIdentifier = "plus-yearly"
    )
) {
    PremiumMarketingContent()
}

Use defaultPurchaseOptionIdentifier to choose the option selected initially. When that option is unavailable, the paywall selects the first option that can be purchased.

Customize the presentation

Use isIncluded to show a subset of the catalog without affecting entitlements or restoration. Match your app design with PaywallStyle and the content slot. To build your own product cards, create a PaywallModel and pass it to PaywallView with productCard. Connect the replacement callback on paywalls that change an existing subscription.

Screen container ownership

PaywallView provides the purchase UI. Configure navigation, tabs, toolbars, and close buttons in the app screen that contains the paywall.