Search code examples
javascriptreactjsnext.jsstripe-payments

Stripe Address Element Add Asterisks To Required


I'm using the AddressElement from Stripe in React/Next.

How can I customize the label for the input?

For example, if I want a * to show up for if it's required, how would I do that?

I tried looking at the Appearance API and tried setting some rules, but there's no content available for their CSS rules.


Solution

  • Stripe will show red borders for any required fields that are not filled out during submit. Unfortunately, there's not a way to add additional text (e.g. "*") or show that fields are required before the end-user attempts to fill them out or submit the form.