Card Form Components
Coinflow’s Card Form components provide a streamlined, PCI-compliant way to collect credit card information directly in your application. Instead of managing separate card number, CVV, and expiration inputs, these components bundle everything into a single embeddable form with one tokenize() method.
When to Use Card Form Components
Use these components when you want to:
- Collect card details for a new card checkout without building your own form layout
- Tokenize a card number with expiration for use with the Card Checkout API
- Re-collect a CVV only for a saved card before calling the Saved Card Checkout API
- Apply custom theming (fonts, colors, placeholders) to match your brand
Available Components
All three components expose a tokenize() method via a ref that returns a token you can pass to the Coinflow checkout APIs.
Installation
Tokenizing a New Card
Use CoinflowCardForm to collect the full card details (number, expiration, CVV) and tokenize them in a single call.
Refreshing a Saved Card Token (CVV Only)
When a customer pays with a saved card, you need to re-collect the CVV and refresh the token. Use CoinflowCvvForm with the saved card’s token from the Get Customer endpoint.
In Vue, the CoinflowCardForm component accepts a variant prop to switch between 'card-form', 'card-number-form', and 'cvv-form' modes.
If the saved card can’t be used, the CVV form shows an error instead of a CVV input, calls onInputError with the error message, and tokenize() rejects with the same message. The message is one of:
Card token is invalid. Please add a new card: thetokendoesn’t match a saved card, or the card was saved in a way Coinflow no longer supports.Card entry is unavailable. Please re-enter your card details.: any other error.
When this happens, ask the customer to enter their card again with CoinflowCardForm.
Tokenizing Card Number Only (No CVV)
Use CoinflowCardNumberForm when you only need to collect the card number and expiration — for example, when saving a card for future use without an immediate charge.
tokenize() Response
The tokenize() method returns a CardFormTokenResponse:
CoinflowCvvForm does not return expMonth or expYear since expiration details are already stored with the saved card. It does return bin, lastFour, and cardType.
bin, lastFour, and cardType let you run fraud checks before creating a payment. They are omitted if Coinflow could not register the card at tokenize time, so treat their absence as “card details unavailable” rather than an error.
Theming
All card form components accept a theme prop to customize the look and feel. Theme values are passed as a MerchantTheme object.
The theme values shown above are examples for illustration. Configure your branding in the Merchant Dashboard or contact the Coinflow integrations team to set these values for your account.
Responsive Layout
CoinflowCardForm automatically adapts its layout to the width of the container you place it in — no configuration is required.
- Wide containers — the card number, expiration, and CVV render together on a single row.
- Narrow containers — when there isn’t enough horizontal space for all three fields, the form reflows to two rows: the card number on the first row, with the expiration and CVV on the second.
This is especially useful in mobile checkout UIs, where a single-row layout can clip the card number in narrow viewports. The form measures its own container and switches layouts on the fly, including when the viewport is resized or rotated.
Because the form’s height changes when it reflows, the embedded iframe reports its content height back to the SDK, which resizes the iframe automatically so the fields are never clipped.
To let the form size itself correctly, place it in a container whose width you control and whose height is allowed to grow. Avoid setting a fixed height on the component or its wrapping element — doing so prevents the form from expanding to its two-row layout.
Responsive reflow and automatic height adjustment are built in to CoinflowCardForm. To pick up this behavior, update to the latest version of your SDK (@coinflowlabs/react, @coinflowlabs/vue, @coinflowlabs/angular, or @coinflowlabs/react-native). No code changes are needed.
Component Props Reference
CoinflowCardForm / CoinflowCardNumberForm
CoinflowCvvForm
Token Expiration
Tokens expire if not used within 7 days of creation. Once used, a token is valid for 5 minutes in production. In the sandbox environment, tokens remain valid indefinitely. If a token expires, call tokenize() again to generate a new one.
Migrating from Legacy Card Inputs
The legacy CoinflowCardNumberInput, CoinflowCvvInput, CoinflowCvvOnlyInput, and CoinflowCardOnlyInput components were removed in @coinflowlabs/react 6.0.0, @coinflowlabs/vue 2.0.0, and @coinflowlabs/angular 2.0.0. If you are upgrading from an earlier version, replace them with the Card Form components:
Upgrading to these versions is a breaking change if you still use the legacy components. Replace them before you upgrade.

