Pular para o conteúdo
Criar conta
ou
Entrar
O logotipo da documentação da Stripe
/
Pergunte à IA
Criar conta
Login
Comece já
Pagamentos
Receita
Plataformas e marketplaces
Gestão de valores
Ferramentas para desenvolvedores
Visão geral
Sobre os pagamentos da Stripe
Atualize sua integração
Análise de pagamentos
Pagamentos online
Visão geralEncontre seu caso de usoPagamentos gerenciados
Usar Payment Links
Crie uma página de checkout
Criar uma integração avançada
Crie uma integração no aplicativo
    Visão geral
    Descrição da compra
      Aceite pagamentos no aplicativo
      Adicione formas de pagamento personalizadas
      Personalizar a aparência
      Finalizar pagamentos no servidor
      Salvar dados de pagamento durante o pagamento
      Configurar pagamentos futuros
      Filtrar bandeiras de cartão
    Payment Element integrado
    Link para compras no aplicativo
    Solicitar endereços
    Cartões dos EUA e Canadá
Formas de pagamento
Adicionar formas de pagamento
Gerenciar formas de pagamento
Checkout mais rápido com o Link
Interfaces de pagamento
Payment Links
Checkout
Web Elements
Elements no aplicativo
Cenários de pagamento
Fluxos de pagamento personalizados
Aquisição flexível
Orquestração
Pagamentos presenciais
Terminal
Outros produtos da Stripe
Financial Connections
Cripto
Climate
Página inicialPagamentosBuild an in-app integrationPayment Sheet

Observação

Esta página ainda não está disponível no idioma desejado. Estamos trabalhando para tornar nossa documentação disponível em mais idiomas e vamos disponibilizar a tradução assim possível.

Customize appearance

Customize your mobile integration with the Appearance API.

Copiar página

The mobile Payment Element supports visual customization, which allows you to match the design of your app. The layout stays consistent, but you can modify colors, fonts, and more by creating your PaymentSheet.Configuration object with an appearance object.

  1. Start by customizing the font
  2. Customize colors to match your app
  3. Customize shapes like corner radius
  4. Fine-tune specific components
// The following code creates the appearance shown in the screenshot above val appearance = PaymentSheet.Appearance( colorsLight = PaymentSheet.Colors( primary = Color(red = 36, green = 36, blue = 47), surface = Color.White, component = Color(red = 243, green = 248, blue = 245), componentBorder = Color.Transparent, componentDivider = Color.Black, onComponent = Color.Black, subtitle = Color.Black, placeholderText = Color(red = 115, green = 117, blue = 123), onSurface = Color.Black, appBarIcon = Color.Black, error = Color.Red, ), shapes = PaymentSheet.Shapes( cornerRadiusDp = 12.0f, borderStrokeWidthDp = 0.5f ), typography = PaymentSheet.Typography.default.copy( fontResId = R.font.avenir_next ), primaryButton = PaymentSheet.PrimaryButton( shape = PaymentSheet.PrimaryButtonShape( cornerRadiusDp = 20f ), ) // ... paymentSheet.presentWithPaymentIntent( clientSecret, PaymentSheet.Configuration( merchantDisplayName = merchantName, appearance = appearance ) )

Fonts

Customize the font by setting typography.fontResId to your custom font’s resource ID. The mobile Payment Element uses the font family of your custom font, but determines sizes and weights itself.

To increase or decrease the size of text, set typography.sizeScaleFactor. Stripe multiplies font sizes by this value before displaying them. This setting is useful if your custom font is slightly larger or smaller than the system font.

val appearance = PaymentSheet.Appearance( // … typography = PaymentSheet.Typography.default.copy( sizeScaleFactor = 1.15f, // Increase the size of all text by 1.15x fontResId = R.font.myFont, ), ) val configuration = PaymentSheet.Configuration( // … appearance = appearance )

Colors

Customize the colors in the mobile Payment Element by modifying the color categories defined in PaymentSheet.Colors. Each color category determines the color of one or more components in the UI. For example, primary defines the color of the Pay button and selected items like the Save this card checkbox. Refer to the diagram below to see some of the UI elements associated with each color category.

Observação

To support dark mode, set appearance.colorsDark. You can effectively disable dark mode by setting appearance.colorsDark to the same value as appearance.colorsLight

Shapes

In addition to customizing fonts and colors, you can also customize the corner radius and border width used throughout the mobile Payment Element by setting appearance.shapes.

Specific UI components

The sections above describe customization options that affect the mobile Payment Element broadly, across multiple UI components. We also provide customization options specifically for the primary button (for example, the Pay button). Refer to Appearance.PrimaryButton for the full list of customization options.

Customization options for specific UI components take precedence over other values. For example, appearance.primaryButton.shapes.cornerRadius overrides the value of appearance.shapes.cornerRadius.

Observação

If you have ideas for additional customization options, let us know.

Esta página foi útil?
SimNão
Precisa de ajuda? Fale com o suporte.
Participe do nosso programa de acesso antecipado.
Confira nosso changelog.
Dúvidas? Fale com a equipe de vendas.
LLM? Read llms.txt.
Powered by Markdoc