mountedCard.values and does not accept plain PAN/CVC.
Create a Card Element
Capture Payload Contract
cardElement.mount() returns a mountedCard object. In production checkout, send mountedCard.values.card to your backend.
mountedCard.values.card can still be empty strings.
Options
Event Lifecycle
onComplete means all fields are filled. It does not guarantee the values are valid.colorScheme
SetcolorScheme to the same value as your page theme so the card iframe blends correctly with light or dark surfaces.
Field Control
Validation State
onChange to enable/disable your submit button.
Read Mounted Card Values
After mount, you can read encrypted values frommountedCard.values.
Card number and CVV are encrypted before exposure in
mountedCard.values.Submit Pattern
Live Demo
This sandbox demo mounts the card element directly in Mintlify, appliescolorScheme based on the current docs theme, and shows real-time state plus encrypted values.
Theming
theme accepts:
- A preset:
'clean' | 'minimal' | 'material' - A config object:
{ preset?, styles?, fonts? } - A function theme:
(utils) => ({ styles, fonts })
Preset Preview
This live sandbox preview uses tabs to switch between built-in presets while keeping the same card configuration. The iframe window stays on a light surface for easier visual comparison.Custom Styling
Theme styles are CSS-in-JS rules injected into the secure iframe. You can style CSS selectors, but you cannot change iframe HTML structure.
Full Theme Example
rinne-theme.ts
State Attributes for Selectors
Use these iframe attributes for state-aware styling:Responsive Styling
Use a function theme andutils.media() so breakpoints match the parent document viewport.
Mount Errors
mount() throws when the target selector is invalid or the provider cannot render the component.

