Manually Mount your Element

In some scenarios you may want to fully control the style, the loading flow or simply the provided Element Components don't suit well for your application.

In those cases you manually mount the Stripe Element on any DOM element. In the example bellow, we are mounting a Card Element into the div with id card-element. We need to do 3 things the Card Component usually do for us:

  • Fetch the Elements Object
  • Create the Stripe Element. In this example a card element, but the same approach can be use for any other support payment method.
  • Mount the element into the DOM

With those technique we have access the the Stripe Element directly.

This is a more flexible approach, but also a little bit more involving